-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New getTopazValues method #142
Comments
Hi @aquiros20 We purpose the following values.
{
syncId: String?
} That value can be null as the SDK can return this value. |
Why not deprecating |
Agree witn @marcoskolodny The new method could be: const getTopazInfo = (options: {timeout?: number} = {}) => Promise<{token: string, syncId: string}> And the old one ( /** @deprecated **
const getTopazToken = getTopazInfo; Some questions:
|
That a good approach but sync_id is a value that we only need the SDK to start to fetch and token is an async value that we cannot control how much it would need to be ready. Moving token into this method can make it quite slow. Answering @pladaria questions:
I would focus this issue on creating the new method to fetch the syncID and maybe we can start an other issue to improve that same method to add more features. |
I think it is better to maintain two separated calls in order to simplify the error management. {"type":"GET_TOPAZ_VALUES","id":"0","payload":{"syncId":"Value"}} /Non empty SyncId/ |
With other bridge methods (Specially the ones related to eSim information fetch), we had similar discussions about having one or more bridge methods. IMO more granular bridge methods are always easier to implement, simpler, faster, and can have specific error responses for the specific information being requested. Also, as @WanaldinoTelefonica mentioned, if in this case, information is available in different moments, and error management could be complex as @pmartinbTEF mentions, so, these not be grouped, no? |
Ok, let's go with a new method. @aquiros20, please update the ticket description setting the @pmartinbTEF regarding this:
what's the difference between an empty syncId and a null one? Can we unify both cases as |
I don't know if an empty syncID is the same as a nul one but we can agree that both are not an ID so we can omit from the payload if everyone is agree. |
ok, LGTM |
Done. |
From Topaz SDK we need to obtain a new value and make it available via a new bridge method.
The value is "syncId"
There's already a method that returns a value from Topaz SDK (token) so the behavior should be similar.
The proposed method is as follows:
getTopazValues = () => Promise<{syncId: string}>
This proposal includes a more generic name in order to allow it to return other Topaz values and not only the sync id, in case in the future we require more from Topaz sdk, not to fall in the current situation where the existing method (getTopazToken) is pretty specific. But this part is just a suggestion.
UPDATE: After discussion, the method signature will end up being implemented as follows:
getTopazValues = () => Promise<{syncId?: string}>
Which covers the possible response scenarios:
{"syncId":"Value"}
{"syncId":""}
{}
The text was updated successfully, but these errors were encountered: