-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: BYOS redundant onScreenUpdate calls RELEASE (#1031)
**Background:** Open-Web reported that the `onScreenUpdate` callback is being called more often than expected It should only be triggered after state changes and `next` calls, but they noticed it’s also firing in other scenarios **Root Cause:** After investigating, I found that this happens because we modified the flow state behavior to trigger callbacks on every call to the update function, even when there’s no actual state change As a result, `onScreenUpdate` is called on any flow state update, even when it’s not needed **For example:** We update the state when the application’s visibility changes, and this causes unnecessary `onScreenUpdate` calls **The Fix:** I made the following changes to address this: • Reverted the flow state behavior: Callbacks will now only be triggered when there’s an actual state change, not on every update call • Reverted the step state behavior: Callbacks will now only be triggered when there’s an actual state change, not on every update call • Added a next call timestamp: This acts as a cache buster so that `onScreenUpdate` still gets triggered when next is called, even if the state hasn’t changed • Updated the polling mechanism: The polling mechanism started going out of sync because of the above change, so I adjusted it accordingly **Verification & Testing:** I validated these changes with several flows, and everything seems to be running without issues However, I’m not familiar with every use case of the SDK, so I’d really appreciate your help here I also noticed that unit tests alone aren’t enough to catch all potential regressions I encountered some issues only when running actual flows, even though all unit tests passed I’ve added more unit tests to cover these cases, but we still need some manual testing to be sure **Request:** Could you please review this change and run some basic tests in the areas you’re familiar with? This will help us ensure there are no regressions and that we can release this fix with greater confidence Thanks in advance for your cooperation!
- Loading branch information
Showing
4 changed files
with
129 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters