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
Client engine is not protected from several property change events when only one property is modified #3312
Comments
So here is the ugly draft which needs to be checked for all possible issue for the my second option from above:
change to
It's method
At least with this code the original issue with |
This issue can cause a lot of confusion and lost time since it is very difficult to trace these client overrides in apps. As Denis mentioned, this can even be a feature instead of a bug for the web component to work this way, thus we should be able to handle the case properly. I have no opinion on the implementation level. Does @Legioth have any opinions ? |
Is this the problematic order of events?
Could the solution in that case simply be that the scheduled task that propagates new values to the element captures the value that was received from the server instead of reading the current value from the state tree? |
Yes and no/how ?
So the question is how/where we should store server received values? Technically my suggestion with the meta-implementation (see above) is a variant of this: we put a value into |
Do we have to explicitly store the value, or would it work to temporarily capture the value from the server in the event instance or directly through some closure? |
Sorry, I don't think I understand you. In reality we already have a bug in our code which is the cause of the #2460 (without any additional events from the client side). The issue with #2460 is: when we get the event about property change we have no information which property is changed. So the current code just goes through ALL the properties and check whether they are changed. The Normally we should identify which property is the target of the event and send changes to the server ONLY for this property. |
See the implementation here: #3331 |
See detailed description of the issue here #2460 (comment).
Technically I don't see a problem from the client side point of view when modification of only one property fires several events (that other properties are also changed).
One property may really lead to changes in other properties (somehow connected e.g. computed properties or for any other reasons).
If it happens and we update the property whose change event is fired (as a result of another property change) in the same request then the current client side property value wins: we will have old value and not the sent from the server. See the details why it happens int he link above.
So we should somehow protect the client engine from such situations.
MapProperty::setValue
method signature so that it accepts one more argument withboolean
type.true
should be provided when this method is called from the message processing of server RPC requests.false
if it's called from the client side.true
is stored in the field insideMapProperty
and any call withfalse
is discarded if this field has valuetrue
. In the end of RPC message processing the value for all updatedMapProperty
instances should be set tofalse
(though I don't know whether the property updates still happens when message processing is in progress). In this way all client side changes will be just ignored if the server side updates are not yet applied.The text was updated successfully, but these errors were encountered: