This bug was introduced at a refactor after the fix. This regression exposes an unexpected RIPE SDK behavior - when we do setInitialsExtra it sets ripe.initialsExtra but not ripe.options.initialsExtra.
On the other hand config() sets both ripe.initialsExtra and ripe.options.initialsExtra, that's why it was working before the refactor when we were doing everything in config().
Now RIPE White uses $ripe.initials, $ripe.engraving and $ripe.initialsExtra for the originalState and $ripe.options.initials, $ripe.options.engraving and $ripe.options.initialsExtra for the state. When we reproduce the bug by changing to a different model it will reset the originalState correctly but not the state (ripe.options.initialsExtra is still dirty with old model's personalization). This buttonText showing the old personalization happens only for a short amount of time depending on how fast the JS code runs because it later receives an event with empty personalization which overrides it but the old state always remains there.
This fix sets both ripe.initialsExtra and ripe.options.initialsExtra when doing setInitialsExtra
Note:setSize already writes to both this.size and this.options.size so we might want the same effect for setInitials and setInitialsExtra.
We need to be careful to avoid breaking changes at a core level, I've made updating options optional (using override flag) this is in line with other methods in Ripe and should fix the behaviour.
setInitialsExtra
it setsripe.initialsExtra
but notripe.options.initialsExtra
.On the other hand
config()
sets bothripe.initialsExtra
andripe.options.initialsExtra
, that's why it was working before the refactor when we were doing everything inconfig()
.Now RIPE White uses
$ripe.initials
,$ripe.engraving
and$ripe.initialsExtra
for theoriginalState
and$ripe.options.initials
,$ripe.options.engraving
and$ripe.options.initialsExtra
for thestate
. When we reproduce the bug by changing to a different model it will reset theoriginalState
correctly but not thestate
(ripe.options.initialsExtra
is still dirty with old model's personalization). This buttonText showing the old personalization happens only for a short amount of time depending on how fast the JS code runs because it later receives an event with empty personalization which overrides it but the old state always remains there.This fix sets both
ripe.initialsExtra
andripe.options.initialsExtra
when doingsetInitialsExtra
Note: setSize already writes to both
this.size
andthis.options.size
so we might want the same effect forsetInitials
andsetInitialsExtra
.