[FIX] Cell: do not rely on key presence in commands#7795
Closed
[FIX] Cell: do not rely on key presence in commands#7795
Conversation
Collaborator
b6da421 to
dbdc2c8
Compare
The mock transport service did not serialize the messages the same way
it would occur in real life.
```ts
JSON.parse(JSON.stringify({ a: undefined })) === {}
deepCopy({ a: undefined }) === { a: undefined }
```
Task: 5499921
dbdc2c8 to
e5aaf6a
Compare
| this.dispatch("UPDATE_CELL", { | ||
| ...target, | ||
| content, | ||
| content: content ?? null, |
Collaborator
There was a problem hiding this comment.
null or an empty string ?
Empty string does the job I think and doesn't introduce another special case.
Suggested change
| content: content ?? null, | |
| content: content ?? "", |
Collaborator
Author
There was a problem hiding this comment.
updated with the suggestion l:)
In our handler of `UPDATE_CELL`, we rely on the presence of a given key in the command to decide how to process it. However, undefined keys tend to be purged from a payload when serialized, which mean different users do not receive the same command payload and their state ends up diverging. E.g.: - Alice write something in A1 - Alice copies an empty cell - Alice pastes it to A1 For Alice, A1 is empty for others, A1 content did not change The same applies to the formats but can only be replicated in later versions (18.0 +): - Alice writes `2` in A1 - Alice adds a `%` format to A2 - Alice copies A1 and pastes it *as value only* to A2 Alice sees no `%` in A2 while other users see it. Task: 5499921
e5aaf6a to
4636a27
Compare
Collaborator
|
@rrahir @LucasLefevre because this PR has multiple commits, I need to know how to merge it:
|
Collaborator
|
robodoo rebase-ff |
Collaborator
|
Merge method set to rebase and fast-forward. |
robodoo
pushed a commit
that referenced
this pull request
Jan 30, 2026
The mock transport service did not serialize the messages the same way
it would occur in real life.
```ts
JSON.parse(JSON.stringify({ a: undefined })) === {}
deepCopy({ a: undefined }) === { a: undefined }
```
Task: 5499921
Part-of: #7795
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
robodoo
pushed a commit
that referenced
this pull request
Jan 30, 2026
In our handler of `UPDATE_CELL`, we rely on the presence of a given key in the command to decide how to process it. However, undefined keys tend to be purged from a payload when serialized, which mean different users do not receive the same command payload and their state ends up diverging. E.g.: - Alice write something in A1 - Alice copies an empty cell - Alice pastes it to A1 For Alice, A1 is empty for others, A1 content did not change The same applies to the formats but can only be replicated in later versions (18.0 +): - Alice writes `2` in A1 - Alice adds a `%` format to A2 - Alice copies A1 and pastes it *as value only* to A2 Alice sees no `%` in A2 while other users see it. closes #7795 Task: 5499921 Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
This was referenced Jan 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

In our handler of
UPDATE_CELL, we rely on the presence of a given key in the command to decide how to process it. However, undefined keys tend to be purged from a payload when serialized, which mean different users do not receive the same command payload and their state ends up diverging.E.g.:
For Alice, A1 is empty
for others, A1 content did not change
The same applies to the formats but can only be replicated in later versions (18.0 +):
2in A1%format to A2Alice sees no
%in A2 while other users see it.Task: 5499921
Description:
description of this task, what is implemented and why it is implemented that way.
Task: TASK_ID
review checklist