Use server-sent GC grace period per spec#99
Conversation
Not sure why I didn't put it there in 2167277.
WalkthroughThe PR implements dynamic garbage collection grace period configuration by reading server-provided values from connection details. It introduces a GracePeriod enum to distinguish between fixed and dynamic grace periods, adds lifecycle hooks to update the grace period on connection establishment, and includes integration tests to verify the behavior. Changes
Sequence DiagramsequenceDiagram
participant Test
participant Plugin as DefaultInternalPlugin
participant Connection as ARTConnection
participant InternalObjects as InternalDefaultRealtimeObjects
participant GC as GC Scheduler
Test->>Connection: Establish connection
Connection-->>Plugin: Connection succeeded<br/>with ARTConnectionDetails
Note over Connection: objectsGCGracePeriod provided<br/>in connection details
Plugin->>Plugin: nosync_onConnected()<br/>Extract gracePeriod from details
Plugin->>InternalObjects: nosync_setGarbageCollectionGracePeriod<br/>(dynamicGracePeriod)
activate InternalObjects
InternalObjects->>InternalObjects: Update mutableState<br/>.garbageCollectionGracePeriod<br/>to dynamic value
deactivate InternalObjects
Note over InternalObjects: GC operations now use<br/>server-provided grace period
InternalObjects->>GC: performGarbageCollection()<br/>uses updated grace period
GC->>GC: Schedule cleanup with<br/>server-provided timeout
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (9)
🧰 Additional context used📓 Path-based instructions (4)**/*.swift📄 CodeRabbit inference engine (.cursor/rules/swift.mdc)
Files:
Tests/**/*.swift📄 CodeRabbit inference engine (.cursor/rules/testing.mdc)
Files:
Sources/AblyLiveObjects/**/*.swift📄 CodeRabbit inference engine (.cursor/rules/swift.mdc)
Files:
Sources/**/*.swift📄 CodeRabbit inference engine (.cursor/rules/testing.mdc)
Files:
🧬 Code graph analysis (3)Sources/AblyLiveObjects/Internal/DefaultInternalPlugin.swift (1)
Sources/AblyLiveObjects/Internal/InternalDefaultRealtimeObjects.swift (1)
Tests/AblyLiveObjectsTests/JS Integration Tests/ObjectsIntegrationTests.swift (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
🔇 Additional comments (14)
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. Comment |
Skipped in 2167277 due to time constraints. Integration tests copied from JS at
b2e5121.The ably-cocoa changes are in ably/ably-cocoa#2150.
Resolves #32.
Summary by CodeRabbit
Chores
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.