This has two benefits:
- The APNS server should only send an iOS client a single push
notification for any missed messages while the device is offline
(server-side coalescing). Note that the client can still turn that
into multiple "user notifications" as it pulls from its queue.
- If multiple notifications get delivered but iOS is unable to process
them (say, because the phone just restarted and hasn't been unlocked
yet), the user should only get one "You may have received messages"
notification (client-side coalescing).
* Work in progress...
* Finish first pass draft of MessagesDynamoDb
* Use begins_with everywhere for destination device id
* Remove now unused methods
* First basic test built
* Add another test case
* Remove comment
* Verify more of the message contents
* Ensure all methods are tested
* Integrate MessagesDynamoDb into the MessagesManager
This change plugs the MessagesDynamoDb class into the live serving
flow in MessagesManager.
Tests are not yet as comprehensive for this big a change as they
should be, but they now compile and pass so checkpointing here with a
commit.
* Put DynamoDB before RDBS when deleting specific messages
* Extract method
* Make aws sdk version into a property
* Rename clientBuilder
* Discard messages with no GUID
* Unify batching logic into one function
* Comment on the source of the value in this constant
* Inline method
* Variable name swizzle
* Add timers to all public methods
* Add missing return statements
* Reject messages that are too large with response code 413
* Add configuration to control dynamo DB timeouts
* Set server timestamp from the ReceiptSender
* Change to shorter key names to optimize IOPS
* Fix tests broken by changing column names
* Fix broken copyright template output
* Remove copyright template error text
* Add experiments to control use of dynamo and rds in message storage
* Specify instance profile credentials for the dynamic configuration manager
* Use property for aws sdk version
* Switch dynamo to instance profile credentials
* Add metrics to the batch write loop
* Use placeholders in logging
* Revert "Send all messages via keyspace notifications when a feature flag is enabled."
This reverts commit fadcf62166.
* Revert "Consolidate semaphore release logic."
This reverts commit c02b255766.
* Revert "Represent stored message state as an enumeration rather than a collection of booleans."
This reverts commit 89788fa665.
* Revert "Refactor: collapse state into semaphores/atomic booleans."
This reverts commit a052e2ee8f.
* Revert "Refactor: move sendNextMessagePage into its own method."
This reverts commit 158e5004b7.
* Revert "Avoid querying the database if we think all new messages are in the cache."
This reverts commit 6f9ff3be37.
* Revert "Query for more stored messages if an update happens while we're already processing a batch."
This reverts commit f766c57743.
* Revert "Only send the "queue cleared" message once per websocket session."
This reverts commit 8f53152c3e.
* Revert "Let processStoredMessages handle requery logic."
This reverts commit 7bbc88d716.
* Revert "Only allow one thread to process stored messages at a time."
This reverts commit 68256d2343.