This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/plugins/chat/spec
Martin Brennan ba1b95c9f4
FIX: Uploading multiple files to chat could cause canellations (#20605)
When we introduced `existingUploads` as an arg to the
ChatComposerUploads component, we also introduced a bug where
if multiple uploads were being done at once, and the draft
was saved, then because of didReceiveAttrs we would cancel
the currently uploading files because the draft uploads became
the existingUploads.

To work around this, since we do want to keep this on didReceiveAttrs
for cases when the user opens a draft or edits another message,
the easiest thing to do is to just not save uploads into the chat
draft if there are still uploads in progress. That way only when
all uploads are complete do we make them a part of the draft.

There is a small risk that the user could do something to lose
their uploads in the draft, but it's a better gamble to have
that happen rather than in progress uploads to be cancelled
while the user is waiting for them to be done because of the
draft.

Also changes the uploads system spec back to the old way of
attaching multiple files since that is why it was failing.
2023-03-09 09:17:54 +01:00
..
components DEV: Always create chat mention records (#20470) 2023-03-07 19:07:11 +04:00
fabricators DEV: do not fabricate a Notification when fabricating a ChatMention (#20450) 2023-02-27 14:41:28 +04:00
integration DEV: Pass messageId as a dynamic segment instead of a query param (#20013) 2023-02-01 12:39:23 -03:00
jobs DEV: Always create chat mention records (#20470) 2023-03-07 19:07:11 +04:00
lib DEV: Fix broken plugin specs because of bookmarkable changes (#20574) 2023-03-08 10:39:51 +08:00
mailers DEV: do not fabricate a Notification when fabricating a ChatMention (#20450) 2023-02-27 14:41:28 +04:00
models DEV: Fix another chat bookmark spec (#20578) 2023-03-08 14:55:14 +10:00
queries DEV: rework the chat-live-pane (#20519) 2023-03-03 13:09:25 +01:00
requests DEV: rework the chat-live-pane (#20519) 2023-03-03 13:09:25 +01:00
serializer DEV: rework the chat-live-pane (#20519) 2023-03-03 13:09:25 +01:00
services DEV: Use service objects for chat thread lookup (#20276) 2023-02-16 19:17:26 +01:00
support DEV: Enable unless cops 2023-02-21 10:30:48 +01:00
system FIX: Uploading multiple files to chat could cause canellations (#20605) 2023-03-09 09:17:54 +01:00
validators DEV: Move discourse-chat to the core repo. (#18776) 2022-11-02 10:41:30 -03:00
plugin_helper.rb DEV: Change Bookmarkable registration to DiscoursePluginRegistry (#20556) 2023-03-08 10:39:12 +10:00
plugin_spec.rb DEV: Pass messageId as a dynamic segment instead of a query param (#20013) 2023-02-01 12:39:23 -03:00