Contacts autolinker is never run, even on 2nd boot (Bug #1143)


Added by Doug Reeder over 1 year ago. Updated about 1 year ago.


Status:Closed Start date:05/16/2016
Priority:Normal Due date:
Assignee:Christophe Chapuis % Done:

100%

Category:System Services
Target version:Touba

Description

To reproduce:
  1. Reboot, to ensure on 2nd or later boot
  2. From a shell on LuneOS, run dmesg | grep contacts.linker Observe no lines are output.
  3. From the LuneOS shell, run journalctl -a -f | grep "contacts.linker"
  4. Run Contacts, tap "Add Contact", fill in nickname, tap "Done". (the new contact is not displayed in the list, but a com.palm.contact:1 record is created in DB8) Observe that nothing is output from journalctl.
  5. In a different LuneOS shell, run luna-send -n 1 -a com.palm.app.contacts luna://com.palm.db/find '{"query": {"from": "com.palm.contact:1"}}' and verify that the contact:1 record has been created:
  6. Run luna-send -n 1 -a com.palm.app.contacts luna://com.palm.db/find '{"query": {"from": "com.palm.person:1"}}' and observe that the corresponding person:1 record has not been created
  7. Run luna-send -n 1 palm://com.palm.service.contacts.linker/forceAutolink '{}' Observe that journalctl outputs May 15 23:38:35 tenderloin ls-hubd[783]: SERVICE_PATH is /usr/palm/services/com.palm.service.contacts.linker and the person appears in the Contacts app.
  8. Re-run luna-send -n 1 -a com.palm.app.contacts luna://com.palm.db/find '{"query": {"from": "com.palm.person:1"}}' and observe that the corresponding person:1 record has been created

The same thing happens for contacts synced via C+DAV from Google.


activity55.txt (50.9 kB) Herman van Hazendonk, 07/05/2016 06:27 pm

activity56.txt (17.9 kB) Herman van Hazendonk, 07/05/2016 06:27 pm


History

Updated by Herman van Hazendonk about 1 year ago

Seems that the following command is being run according to: /usr/share/dbus-1/system-services/com.palm.service.contacts.linker.service

/usr/bin/run-js-service -n /usr/palm/services/com.palm.service.contacts.linker

When I manually run that I get "Error: ENOENT, no such file or directory '/etc/palm/contact_linker_plugins/'"

Checking legacy this folder exists, has some files that don't seem relevant for us. Creating the empty folder will make sure we don't get the error at least, so that seems a good thing to do anyway. I need to test if it solves the issue with the linker itself still.

  • Target version set to Touba
  • % Done changed from 0 to 10
  • Assignee set to Achim Königs
  • Status changed from New to In Progress

Updated by Herman van Hazendonk about 1 year ago

Adding the directory doesn't seem to solve the issue.

Updated by Herman van Hazendonk about 1 year ago

It seems that we have a lot less activities running it seems compared to earlier.

The /etc/palm/activities files are all there. It seems somehow configurator might not pick them up. The logs show nothing obvious. See attached the difference between QT5.5 (Fido) and QT 5.6 (Jethro).

It could be a multitude of things.

1. The contents in /etc/palm/activities is binary identical, so unlikely to be a cause.
2. We're using -fpermissive now for configurator & activitymanager but this shouldn't cause the issue, though it might. Not sure how to debug. https://github.com/webOS-ports/meta-webos-ports/commit/9f6f0281ac991a5f7149bbf69706f17c2a6faa4e
3. It could be the NodeJS upgrade somehow is interfering with things. It would be good to double check https://github.com/webOS-ports/app-services to make sure they're fine with NodeJS 4.4, just not sure how to do this.

Updated by Doug Reeder about 1 year ago

After the following command is run once, the contacts linker appears to run normally:

luna-send -n 1 palm://com.palm.service.contacts.linker/dbUpdatedRelinkChanges '{}'

This is the callback from the activity in /etc/palm/activities/com.palm.service.contacts.linker/com.palm.service.contacts.linker.json , without the revChangedStart parameter.

Tested on an N4 with the testing build from 2016-07-11.

Updated by Doug Reeder about 1 year ago

com.palm.service.contacts.linker/forceAutolink calls Autolinker.performAutolink(undefined, controller, jobId);
while
com.palm.service.contacts.linker/dbUpdatedRelinkChanges calls Autolinker.performAutolink(param.revChangedStart || -1, controller, jobId);
(that is, it only processes changes since the last time it was run), but dbUpdatedRelinkChanges also calls controller.service.assistant.dispatchToPlugins("syncDone") and Autolinker.restartActivityUsingRevisionNumber(activity._activityId, this.controller.lastProcessedContactRevId), which sets a watch on the contacts kind.

So, an ugly hack would be to run at some point after startup. A better solution would be to understand why the activity is not properly started after first use.

Updated by Herman van Hazendonk about 1 year ago

Not sure what's up with this. NodeJS seems fine for it. Could be ActivityManger, Configurator or Systemd. Best to check Systemd first.

  • % Done changed from 10 to 40
  • Assignee changed from Achim Königs to Christophe Chapuis

Updated by Christophe Chapuis about 1 year ago

The file "/var/luna/preferences/first-use-profile-created" is not there, and as a consequence configurator only starts the first-use activities. Creating this file and rebooting fixes the issue. Also I think that creating the /etc/palm/contact_linker_plugins directory helped, for the linker activity.
Now the question is, when should this file be created...

Updated by Herman van Hazendonk about 1 year ago

Should be solved with https://github.com/webOS-ports/app-services/commit/32f2212b10c99a362b2122419a0f79c228634463 that will make sure that the correct marker is being set after the local account has been created.

  • % Done changed from 40 to 100
  • Status changed from In Progress to Feedback

Updated by Herman van Hazendonk about 1 year ago

Tested it locally and contact autolinker runs after Google C+DAV account is added. Will be available in the next nightly as well.

Updated by Herman van Hazendonk about 1 year ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF