Skip to content

Conversation

@hokolomopo
Copy link
Contributor

@hokolomopo hokolomopo commented Apr 22, 2025

Description:

[FIX] tests: indeterministic tests with debounce

When creating a model, we trigger a session.move that is debounced,
and that trigger a render when the debounce is over. This can lead to
indeterministic tests, with random renders happening in the middle of
a test.

This commit removes the debounce of session.move for all the tests.

[IMP] registries: remove registries index

We had a index.ts file for some registries. The file was a bit of a
problem because:

  • It mixes apples and oranges: some registries are purely UI, some not,
    so importing everything at once don't really make sense.
  • It is an easy source of circular dependencies. For example, we had
    to split side_panel_registry in two files to avoid circular dependencies

This commit removes the index.ts file and imports the registries
individually where needed.

[IMP] session: better handling of session.move

Currently, session.move do nothing if session.join is not called
beforehand. But as it turns out, we do actually call session.move
before session.join. It just always work in practice, because
session.move is debounced.

With this commit, we store the client position in session.move, and
send it to the server when session.join is called.

Task: 4737879

review checklist

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_t("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

Currently, `session.move` do nothing if `session.join` is not called
beforehand. But as it turns out, we do actually call `session.move`
before `session.join`. It just always work in practice, because
`session.move` is debounced.

With this commit, we store the client position in `session.move`, and
send it to the server when `session.join` is called.

Task: 4737879
We had a `index.ts` file for some registries. The file was a bit of a
problem because:

- It mixes apples and oranges: some registries are purely UI, some not,
    so importing everything at once don't really make sense.
- It is an easy source of circular dependencies. For example, we had
    to split `side_panel_registry` in two files to avoid circular dependencies

This commit removes the `index.ts` file and imports the registries
individually where needed.

Task: 4737879
@robodoo
Copy link
Collaborator

robodoo commented Apr 22, 2025

Pull request status dashboard

@rrahir
Copy link
Collaborator

rrahir commented Apr 30, 2025

@robodoo rebase-ff

@robodoo
Copy link
Collaborator

robodoo commented Apr 30, 2025

Merge method set to rebase and fast-forward.

When creating a model, we trigger a `session.move` that is debounced,
and that trigger a render when the debounce is over. This can lead to
indeterministic tests, with random renders happening in the middle of
a test.

This commit removes the debounce of `session.move` for all the tests.

Task: 4737879
@rrahir rrahir force-pushed the master-fix-debounce-test-adrm branch from 52ebce2 to 4254065 Compare April 30, 2025 09:34
Copy link
Collaborator

@LucasLefevre LucasLefevre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

robodoo r+

robodoo pushed a commit that referenced this pull request Apr 30, 2025
Currently, `session.move` do nothing if `session.join` is not called
beforehand. But as it turns out, we do actually call `session.move`
before `session.join`. It just always work in practice, because
`session.move` is debounced.

With this commit, we store the client position in `session.move`, and
send it to the server when `session.join` is called.

Task: 4737879
Part-of: #6162
Signed-off-by: Lucas Lefèvre (lul) <[email protected]>
robodoo pushed a commit that referenced this pull request Apr 30, 2025
We had a `index.ts` file for some registries. The file was a bit of a
problem because:

- It mixes apples and oranges: some registries are purely UI, some not,
    so importing everything at once don't really make sense.
- It is an easy source of circular dependencies. For example, we had
    to split `side_panel_registry` in two files to avoid circular dependencies

This commit removes the `index.ts` file and imports the registries
individually where needed.

Task: 4737879
Part-of: #6162
Signed-off-by: Lucas Lefèvre (lul) <[email protected]>
robodoo pushed a commit that referenced this pull request Apr 30, 2025
When creating a model, we trigger a `session.move` that is debounced,
and that trigger a render when the debounce is over. This can lead to
indeterministic tests, with random renders happening in the middle of
a test.

This commit removes the debounce of `session.move` for all the tests.

closes #6162

Task: 4737879
Signed-off-by: Lucas Lefèvre (lul) <[email protected]>
@robodoo robodoo added the 18.4 label Apr 30, 2025
@robodoo robodoo closed this Apr 30, 2025
@fw-bot fw-bot deleted the master-fix-debounce-test-adrm branch May 7, 2025 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants