Repository navigation
Fix subscription events issuing new subscription requests - #11
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughСобытия ChangesСостояние подписки удалённого трека
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Subscription events now update remote publication state without sending duplicate subscription requests, preserving delegate delivery and preventing stale event handling from overwriting newer application intent. The covered behavior is ready to merge. Sequence Diagram(s)sequenceDiagram
participant FfiEvents
participant Room
participant RemoteTrackPublication
participant RoomDelegate
FfiEvents->>Room: track_subscribed или track_unsubscribed
Room->>RemoteTrackPublication: updateSubscriptionState(true или false)
Room->>RoomDelegate: onTrackSubscribed или onTrackUnsubscribed
RoomDelegate-->>Room: проверка состояния публикации
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
Room handles
TrackSubscribedandTrackUnsubscribedby calling the public subscription setter, which sends another request to Rust. A delayed event can therefore overwrite a newer application subscription request; a failed request also prevents the event from reaching the delegate.Use a private state update for those two Room events. Public subscription commands and the class layout remain unchanged. A regression test dispatches 100 subscribe/unsubscribe event pairs through the real FFI callback entry point, using zero publication handles to reject any accidental outbound request and checking publication state and delegate delivery.
Validation: the regression failed against the pinned parent implementation with
setSubscribed: invalid FFI handleand missing delegate callbacks. With the fix, all 34 targeted Room/publication tests pass, including the 100 event pairs. Release SDK and test binaries build; clang-format passes and clang-tidy completes without errors (existing const-correctness warnings remain). No server integration test is claimed from this offline suite.Supports syrnike13/syrnike13-app#131. The application run with SDK commit
d966ceeand app commitb3fa3ecfpassed 100 renderer reloads, 100 crashes and 100 withheld texture-release cycles. Incoming video recovered on every replacement; four outgoing publications retained their identities, with zero observer reconnects or reader failures. Maximum outgoing gaps were 122/114/114 ms; publisher cleanup and normal process exit passed. SDK DLL hashes and source identities were verified unchanged before and after the run. This supports integration of the fix but does not conclusively attribute the earlier intermittent incoming-video stall to this defect.