When the client app comes online or is activated by the user (e.g. switching to an old browser tab, or switching to the desktop app or ios app) it’s supposed to check if the space on the server has newer changes than it does. If it does , then it should display a notification to the user:
However this notification doesn’t seem to reliably show up when old spaces are opened up. Can you find the cause of this buggy behaviour?
The check should happen in checkIfShouldNotifySpaceOutOfSync() in Notifications.vue
I see that in checkIfShouldNotifySpaceOutOfSync() the notification is only triggered when the server’s editedAt is 1 minute newer than the local editedAt
Why is this required? Can’t this be one second?
I also found some typos and smaller issues that was showing this too often. Will submit a PR
However this notification doesn’t seem to reliably show up when old spaces are opened up.
Please clarify what this means. This should happen after you open a space from the space picker? If yes, why does this need to happen? It looks like the client is doing a full refresh from the server when a new space gets opened.
Something I have noticed while working on this is that if you use the space picker to navigate to a space. Change tabs, come back the notification always will be shown. I think this is because the incrementVisits operation, which updates the space.updatedAt and thus will always trigger the notification, even if nothing on the space changed, except that it got visited one more time.
Correction:
There seems to be an editedAt property, but it’s not returned in GET /space/updated-at/{spaceId} so it was always undefined and the current time was used, which caused the notification to always show up.
We would need to add editedAt to this endpoint or create a second endpoint to only get the editedAt date.
no this notification isn’t for opening up a new space from the picker. It’s for scenarios where the space is already open in another tab or in another device. e.g. i open the space on my desktop. the computer goes to sleep. I edit that space on my phone. then wake up the computer and observe what happens to the already opened desktop space.
In my experience, the notification doesn’t show up in the other client (desktop) in this scenario, but it should.
looking for await cache.updateSpace('editedAt.. it looks like the user’s editedAt happens everytime an item is updated. This will fire even when a card update is broadcasted from another user - if the currentuser’s tab is also active at that time.