In the wild, ships that were live pre-OS1 still had launch subscriptions
open to the clock on the /tile path, instead of the currently-used
/clocktile path. Additionally, launch state for the clock tile seemed
incomplete.
Here, we simply re-%add the clock to launch.
Note that launch currently does not clean up old subscriptions on
path change. For the pre-OS1 case, the old path is no longer in use,
rendering the subscription harmless. For cases where the correct
subscription was already in place, it'll print a %watch-wire-not-unique,
but doesn't do any harm besides that.
During the #2607 upgrade, strictly local collections got left out of the
listening set. (Because they did not have any outgoing subscriptions.)
This led to personal collections not being available on the frontend.
Here, we add upgrade logic for adding those back to our listening set again.
If a user had explicitly left a personal collection (instead of deleted it, for
whatever reason), they will have to leave it again. This case seems much more
rare than the "my collection is gone" one.
(Re)subscribing gets us a %contacts update, containing the full set of
contacts as it currently exists.
Previously, we would fully delete our local state, only to recreate it
using the data from the update.
Now, we never delete existing data, instead only creating if we don't
have it yet, and adding, removing or recreating contacts if they
changed.
In the future, we'll want an easy way to turn two contacts into an %edit
diff, to let us apply correct semantics to individual contacts, too.
Instead, %bundle and %add if we don't have the group locally yet,
or %add and %remove whatever the difference is between the local group
and the group as specified in the %path update.
In both, we make clear that the wire is always of the /@/group/^ form,
and alias the "group path" portion of the wire for clarity.
For kick, more obviously reuse the same wire, don't reconstruct it.
For watch-nack, only delete from the synced map if the source of the
watch-nack is still relevant. While we don't expect this to be relevant
considering current mode of operation, this does protect us against
strange cases.
Instead of going purely off metadata, we now track the collections we're
listening to, and allow the user to remove collections from that list.
This allows us to remove/ignore collections, without mutilating group
assocations locally.
We were taking care not to re-add something to our data store if we
already had it in there, but were still sending out an update
regardless.
With this, we only send out an update if we weren't previously aware
of the content.
If chats with identical resource paths were created, that would result
in chat-hook seeing updates twice.
These "/mailbox wire sub to local chat-store" subscriptions aren't
created by the current logic anymore, and as such any existing ones
should be eradicated.