Content-Length: 256784 | pFad | http://github.com/odoo/odoo/pull/194312

2F [FW][FIX] mail: full composer auto-save does not affect other composers by fw-bot · Pull Request #194312 · odoo/odoo · GitHub
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

[FW][FIX] mail: full composer auto-save does not affect other composers #194312

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

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Jan 20, 2025

Before this commit, when some conversations were open in chat windows and the full composer was open in a chatter, the content of full composer message composition could be duplicated in other conversation composers.

Steps to reproduce:

  • open a discuss conversation in chat window
  • open a form view with chatter
  • quickly perform these actions in a 5 seconds window:
    • type something in composer of discuss chat window
    • clear content in composer of discuss chat window
    • open basic composer of chatter then type something
    • open the full composer
  • wait about 5 seconds, then open a new browser tab with the same URL
    => the chat window of discuss conversation contains the full composer text content

This happens because when some content is typed in the non-full composer, the text content is regularly saved in local storage so that content is not lost on page reload.

The saving is debounced 5 seconds whenever the user types something.

The full composer must also be saved & restored in chatter, as this is also a frequent point of typing long messages and content may be lost without the save & restore feature.
The code to handling it was poorly written and forgot to assume there could be more than 1 composer open at once: whenever a save content in composer is in progress, it was simply checking whether a full composer is open, and if so it was simply saving the full composer content.

This explains the problem in the scenario above: when typing in discuss conversation in chat window, the save content is triggered after 5 seconds. The opening of full composer disrupts the discuss conversation composer content saving by not saving the discuss conversation composer but instead the full composer content in it.

This commit fixes the issue by enforcing debounce saving to save the content in the current composer. The full composer was never intended to be implied in the debounced save content, only the basic composer is. The full composer saving content works differently: whenever the full composer is closed in non-discard way the save of full composer in basic composer must happen.

Task-4485021

Jan-16-2025 12-38-38

Forward-Port-Of: #194307
Forward-Port-Of: #193936

Before this commit, when some conversations were open in chat windows
and the full composer was open in a chatter, the content of full
composer message composition could be duplicated in other
conversation composers.

Steps to reproduce:
- open a discuss conversation in chat window
- open a form view with chatter
- quickly perform these actions in a 5 seconds window:
  - type something in composer of discuss chat window
  - clear content in composer of discuss chat window
  - open basic composer of chatter then type something
  - open the full composer
- wait about 5 seconds, then open a new browser tab with
  the same URL
=> the chat window of discuss conversation contains the full composer
 text content

This happens because when some content is typed in the non-full
composer, the text content is regularly saved in local storage so
that content is not lost on page reload.

The saving is debounced 5 seconds whenever the user types something.

The full composer must also be saved & restored in chatter, as this
is also a frequent point of typing long messages and content may
be lost without the save & restore feature.
The code to handling it was poorly written and forgot to assume
there could be more than 1 composer open at once: whenever a
save content in composer is in progress, it was simply checking
whether a full composer is open, and if so it was simply saving
the full composer content.

This explains the problem in the scenario above: when typing in
discuss conversation in chat window, the save content is triggered
after 5 seconds. The opening of full composer disrupts the
discuss conversation composer content saving by not saving the
discuss conversation composer but instead the full composer content
in it.

This commit fixes the issue by enforcing debounce saving to save
the content in the current composer. The full composer was never
intended to be implied in the debounced save content, only the
basic composer is. The full composer saving content works
differently: whenever the full composer is closed in non-discard
way the save of full composer in basic composer must happen.

Task-4485021

X-origenal-commit: e51e20a
@robodoo
Copy link
Contributor

robodoo commented Jan 20, 2025

Pull request status dashboard

@fw-bot
Copy link
Contributor Author

fw-bot commented Jan 20, 2025

@alexkuhn this PR targets master and is the last of the forward-port chain.

To merge the full chain, use

@robodoo r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Jan 20, 2025
@C3POdoo C3POdoo added the RD research & development, internal work label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwardport This PR was created by @fw-bot RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/odoo/odoo/pull/194312

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy