ripe-tech / ripe-sdk

The public Javascript SDK for RIPE Core
https://www.platforme.com
Apache License 2.0
8 stars 4 forks source link

SDK slow response when doing setInitialsExtra #357

Closed 3rdvision closed 2 years ago

3rdvision commented 2 years ago

Description

SDK takes too long to update images when calling for several setInitialsExtra.

In practice ripe-white takes much longer - more than 2x the amount of time - than RIPE API to render an image after user initials requests.

I believe this has to do with SDK's implementation to cancel old requests - it's not working as expected.

Please watch the videos below.

Expected vs. Observed

- -
Expected The image should render what it's typed on white right away, not the first character and then the whole word.
Observed The observed state at the end of the repro steps.

Repro Steps

  1. Open ripe-white https://ripe-white-now.platforme.com/?context=saint_laurent_hoodie
  2. Write something in initials input with more than 1 character like "1234"
  3. Watch the image first render an image with the first character "1" and only then "1234" no matter how fast it's typed

Videos

From RIPE White

https://user-images.githubusercontent.com/24736423/154675074-28cfaf4d-8b71-4693-a583-aaf27e82d030.mp4

From YSL's Website

https://user-images.githubusercontent.com/24736423/154671733-9ef37962-0f57-49fe-8a61-95b511df74c7.mp4

ripe-tobias-bot[bot] commented 2 years ago

Woof, Woof!

Thank you @SDK slow response when doing setInitialsExtra for submitting the "SDK slow response when doing setInitialsExtra" issue 😎.

Please do not forget to review our internal guidelines:

Engaging in the development process in the best possible way helps it being efficient and fast.

Your friend, Tobias (Platforme's mascot)

Tobias Bot
3rdvision commented 2 years ago

This can be solved by implementing a debouncer when doing setInitialsExtra.

Now this debouncer could be implemented at SDK level and enabled/disabled with a certain timer by default or we just don't implement it and instead pass that responsibility to whoever uses the SDK.

@joamag I'd say this is a point of discussion in tech decision.

joamag commented 2 years ago

discussion

Yes, let's implement it at the SDK level. On top of that let's cancel previous requests when new ones arise if needed.

3rdvision commented 2 years ago

On top of that let's canceled previous requests when new ones arise, if needed.

That one is already implemented

Ok, going ahead with the debouncer implementation at SDK level for the setInitialsExtra.

luisamd commented 2 years ago

@3rdvision Is this story ready for QA? If so, please update the Kanban board 😄

3rdvision commented 2 years ago

@msp-platforme Deployed and ready to test at https://ripe-white-now.platforme.com/?context=saint_laurent_hoodie

msp-platforme commented 2 years ago

We no longer see the first character being rendered first, and then rendering the rest of the inserted characters. In that regard, the expectation is met. Speed performance still is not ideal, @3rdvision will see what else can be done.

https://user-images.githubusercontent.com/72499843/159557140-09699a01-e612-40f1-90f3-8f636e8d50bd.mp4