Skip to content
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

[FIX] CoreViewPlugin: Remove access to dispatch #5070

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from

Conversation

rrahir
Copy link
Collaborator

@rrahir rrahir commented Oct 9, 2024

The CoreView plugins have a local state that is directly derived from the core data. As such, they should not have any impact on plugins other than themselves, especially not on core plugins.

This revision removes the dispatch fro the core view plugins altogether as they don't and should not dispatch anything.

Task: 4241403

Description:

description of this task, what is implemented and why it is implemented that way.

Task: TASK_ID

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

The CoreView plugins have a local state that is directly derived from
the core data. As such, they should not have any impact on plugins other
than themselves, especially not on core plugins.

This revision removes the dispatch fro the core view plugins altogether
as they don't and should not dispatch anything.

Task: 4241403
@robodoo
Copy link
Collaborator

robodoo commented Oct 9, 2024

Pull request status dashboard

rrahir added a commit that referenced this pull request Oct 9, 2024
See #5070 - CoreView plugins replay remote revisions and should not take
the risk to dispatch during the replay. The code that was assigning
arbitrary default values to the cells of a boolean datavalidation has
been moved to a UI feature plugin, hence avoiding the problem raised in
PR #5070.

Task: 4241141
Copy link
Contributor

@hokolomopo hokolomopo left a comment

Choose a reason for hiding this comment

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

That seems like a breaking change so I would do it in master.

Wouldn't it cause problem with pivots/data source ? They need to dispatch EVALUATE_ALL_CELLS and aren't they coreView plugins? And in general removing the dispatch from the CoreView plugin sounds good in paper, but I think there might be relevant use case where a core_view would want to diapatch an UI command.

@@ -14,6 +14,11 @@ import {
import { BasePlugin } from "./plugins/base_plugin";
import { RangeAdapter } from "./plugins/core/range";
import { CorePlugin, CorePluginConfig, CorePluginConstructor } from "./plugins/core_plugin";
import {
Copy link
Contributor

Choose a reason for hiding this comment

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

typo in commit msg dispatch fro the core view

rrahir added a commit that referenced this pull request Oct 10, 2024
See #5070 - CoreView plugins replay remote revisions and should not take
the risk to dispatch during the replay. The code that was assigning
arbitrary default values to the cells of a boolean datavalidation has
been moved to a UI feature plugin, hence avoiding the problem raised in
PR #5070.

Task: 4241141
rrahir added a commit that referenced this pull request Oct 10, 2024
See #5070 - CoreView plugins replay remote revisions and should not take
the risk to dispatch during the replay. The code that was assigning
arbitrary default values to the cells of a boolean datavalidation has
been moved to a UI feature plugin, hence avoiding the problem raised in
PR #5070.

Task: 4241141
@rrahir
Copy link
Collaborator Author

rrahir commented Oct 10, 2024

That seems like a breaking change so I would do it in master.

It's already used in bad conditions, so removing it and fixing whatever uses it seems like a good approach - of course assuming no one is relying on this outside of Odoo. I however proposed #5068 which fixed without "breaking".

Wouldn't it cause problem with pivots/data source ? They need to dispatch EVALUATE_ALL_CELLS and aren't they coreView plugins? And in general removing the dispatch from the CoreView plugin sounds good in paper, but I think there might be relevant use case where a core_view would want to dispatch an UI command.

the datasource-related plugins don't dispatch anything, it's the datasource itself that sends a message to the their bus which in turn dispatches a global evaluation.
By blocking the access to dispatch to the coreView plugins we merely force the creation of 'dummy' ui plugins to handle the potential dispatches in order to prevent wrong and quite difficult to detect behaviours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants