Skip to content

feat: adapt Websocket for consumable notifications - WPB-17225 #2918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 48 commits into
base: develop
Choose a base branch
from

Conversation

netbe
Copy link
Collaborator

@netbe netbe commented Apr 18, 2025

TaskWPB-17225 [iOS] Adapt webSocket

Issue

This covers the sync part while the app is in foreground with consumable notifications.

  • Creates a NewIncrementalSync depending on the consumable-notifications capabilities which will be used under a LiveSyncProtocol. It basically create and open a webSocket where we listen to events and process them.
  • Adapts Websocket to send data to server
  • Creates new NewPushChannel to acknowledge events

Note also that to hide the syncbar we assume that after X seconds without receiving new events we're caught up.

Other:

  • Disabled extra tags in console logs

Testing

Use lich environment where notifications.missed event occur every 5minutes meaning the client was offline for too long and needs to perform slow sync

@netbe netbe added the WIP label Apr 18, 2025
Base automatically changed from feat/update-capabilities-WPB-17092 to develop April 18, 2025 16:34
@@ -30,7 +30,8 @@ public struct UpdateEventEnvelopeV0: Decodable, ToAPIModelConvertible {
UpdateEventEnvelope(
id: id,
events: (payload ?? []).map(\.updateEvent),
isTransient: transient ?? false
isTransient: transient ?? false,
deliveryTag: nil
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for old enveloppes there is no acknowledgement so no deliveryTag needed

@@ -60,22 +60,6 @@ public final class Assembly {
return service
}()

private lazy var pushChannelService: some PushChannelServiceProtocol = PushChannelService(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant