You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
We are trying to add some observability to OTA updates. We want to trace success and error cases or even just add logging. But we did not find any way to register the observer without causing other side effects.
This is our code, that does not cause work because Crowdin SDK behaves unexpeced:
Adding the callback via registerDataLoadingObserver has no effect because Crowdin.init has not been called yet. When trying to add it after calling Crowdin.init it does not work either because the network calls already happened.
We also tried delaying the update by using withInitSyncDisabled() but manually calling Crowdin.forceUpdate does not do the checks to updateInterval which is done when using the default config without using withInitSyncDisabled option.
Expected behavior
I can call registerDataLoadingObserver even before Crowdin.init and the observer is registered.
The text was updated successfully, but these errors were encountered:
We can add LoadingStateListener as a third argument to the init function. This will allow you to subscribe to events within the application scope. With this approach, the observer will be registered during initialization, ensuring you receive updates, including those from initial API calls.
If you need to remove the observer later, you can store the listener as property and unregister it using Crowdin.unregisterDataLoadingObserver(listener).
Additionally, where you register the observer using the registerDataLoadingObserver method (e.g., in MainActivity or another component) may affect when you receive updates. If registered early, you might receive both the initial callback and all subsequent updates. Otherwise, you will only receive subsequent events.
Describe the bug
We are trying to add some observability to OTA updates. We want to trace success and error cases or even just add logging. But we did not find any way to register the observer without causing other side effects.
This is our code, that does not cause work because Crowdin SDK behaves unexpeced:
Adding the callback via
registerDataLoadingObserver
has no effect becauseCrowdin.init
has not been called yet. When trying to add it after callingCrowdin.init
it does not work either because the network calls already happened.We also tried delaying the update by using
withInitSyncDisabled()
but manually callingCrowdin.forceUpdate
does not do the checks toupdateInterval
which is done when using the default config without usingwithInitSyncDisabled
option.Expected behavior
I can call
registerDataLoadingObserver
even beforeCrowdin.init
and the observer is registered.The text was updated successfully, but these errors were encountered: