Skip to content

[AIT-280] feat: Implement apply-on-ACK (RTO20) prototype#113

Draft
lawrence-forooghian wants to merge 1 commit intomainfrom
AIT-280-prototype-apply-on-ack
Draft

[AIT-280] feat: Implement apply-on-ACK (RTO20) prototype#113
lawrence-forooghian wants to merge 1 commit intomainfrom
AIT-280-prototype-apply-on-ack

Conversation

@lawrence-forooghian
Copy link
Collaborator

Implement the apply-on-ACK feature which applies LiveObjects operations
locally upon receipt of an ACK message, rather than waiting for the
operation echo. This reduces perceived latency for users.

Key changes:

  • Add appliedOnAckSerials set and bufferedAcks array to MutableState
  • Add PublishResult type containing serials array from ACK res[i].serials
  • Implement RTO9a3: Skip OBJECT messages already applied on ACK
  • Implement RTO5c9-11: Clear/process buffered ACKs on sync completion
  • Add publishAndApply() method for the main apply-on-ACK flow
  • Add canApplyOperationForAck/applyForAck helpers to LiveMap/LiveCounter
  • Integrate apply-on-ACK into set/remove/increment/decrement operations

PublishResult.serials is an array where each element corresponds 1:1 to
the ObjectMessages that were published. publishAndApply processes each
message with its corresponding serial at the matching index.

Note: Full functionality requires ably-cocoa changes:

  • CD2j: Add siteCode to ConnectionDetails
  • Update nosync_sendObject callback to include serials from ACK

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

Implement the apply-on-ACK feature which applies LiveObjects operations
locally upon receipt of an ACK message, rather than waiting for the
operation echo. This reduces perceived latency for users.

Key changes:
- Add appliedOnAckSerials set and bufferedAcks array to MutableState
- Add PublishResult type containing serials array from ACK res[i].serials
- Implement RTO9a3: Skip OBJECT messages already applied on ACK
- Implement RTO5c9-11: Clear/process buffered ACKs on sync completion
- Add publishAndApply() method for the main apply-on-ACK flow
- Add canApplyOperationForAck/applyForAck helpers to LiveMap/LiveCounter
- Integrate apply-on-ACK into set/remove/increment/decrement operations

PublishResult.serials is an array where each element corresponds 1:1 to
the ObjectMessages that were published. publishAndApply processes each
message with its corresponding serial at the matching index.

Note: Full functionality requires ably-cocoa changes:
- CD2j: Add siteCode to ConnectionDetails
- Update nosync_sendObject callback to include serials from ACK

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch AIT-280-prototype-apply-on-ack

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@lawrence-forooghian lawrence-forooghian changed the title feat: Implement apply-on-ACK (RTO20) prototype [AIT-280] feat: Implement apply-on-ACK (RTO20) prototype Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant