at_client_sdk
at_client_sdk copied to clipboard
Skip latestNotificationId to sync to server
Is your feature request related to a problem? Please describe.
At the moment, the latestNotificationId keys gets sync'ed the server. The key gets updated for every notification received and as a result the key gets continuously sync'ed to the server which created a lot of load on the server. Further, server does not need to know the latestNotificationId.
Proposed Solution:
- Enhance the latestNotificationId as a local key.
- In the at_persistence_secondary_server, in the commit method, modify the IF condition such that local keys are NOT added to commit log.
- In the at_client SDK, update the latestNotificationId as a local key. Fetch from the old 'latestNotificationId' and set the value as a default value to the latestNotificationId and store it to the keystore.
- Do not update/fetch the data from the old 'latestNotificationId'. So, that old key becomes unusable and do not get sync'ed continuously.
Backward Compatibility:
- Since the older key is not refrained in the commit log, in case of old client and new server (or) new client and old server, the key gets still sync'ed without causing the sync imbalance.
@kalluriramkumar Any progress on this?
@kalluriramkumar Any progress on this?
The code changes are completed. Following are the PR's
- at_commons: https://github.com/atsign-foundation/at_tools/pull/242
- at_persistence_secondary_server: https://github.com/atsign-foundation/at_server/pull/979
- at_client_sdk: https://github.com/atsign-foundation/at_client_sdk/pull/760
The code changes are completed in PR-47. Pending work: PR reviews, merging to trunk and publishing packages. Moving to PR-48 and re-estimating to 3 SP.
Verified the changes with atMospherePro app and latency tests.
- With atMosphere pro app,
- With an old atsign the _latestNotificationIdv2 was available for the first time, But later the key was not synced.
- With a new atsign, the _latestNotificationIdV2 was not being created. Attaching app logs, atMosphereProLogs.txt
- With notification latency tests. The latency results was better than the previous latency results. Attaching the sheet with the results.
https://docs.google.com/spreadsheets/d/1wY9eFI1OdqaexyR7Ho7ctT6IyNdsdIIB/edit#gid=63467969
In the above sheet, Tab1 shows previous latency results (before this fix) tab2 and 3 shows current latency results.
Added validations in the verb builder so as to guard the sharedWith, isLocal, isPublic and isCached. The changes are in the following PR. Spend 5SP on this in PR-48.
Spent 5SP in PR-49 to refactor the validations in the verb builders, add additional unit tests in at_commons: https://github.com/atsign-foundation/at_tools/pull/245 and consume the changes to at_client SDK and publish at_commons and at_client packages