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 (visually) removing first notification when executing an action #1657

Conversation

danxuliu
Copy link
Member

@danxuliu danxuliu commented Sep 6, 2023

When an action is executed first its element is faded out and then the notification data is removed, which removes the component as a whole. However, the index of the notification was not provided, so the event that handles the "remove" event always removed the data of the first notification. Due to this when the action was triggered in another notification the first notification was also (visually) removed (and only until the notifications were fetched again from the server).

How to test

  • Setup the recording server in Talk
  • Start a call
  • Start and stop (once it has started, do not cancel the start) a recording three times
  • Once the three notifications about a recording being available are shown, share to the chat the oldest of the recordings (the notification at the bottom)

Result with this pull request

The last notification is removed

Result without this pull request

Both the first and the last notifications are removed. If you keep the notifications open long enough (so the notifications are fetched again) the first notification will appear again

When an action is executed first its element is faded out and then the
notification data is removed, which removes the component as a whole.
However, the index of the notification was not provided, so the event
that handles the "remove" event always removed the data of the first
notification. Due to this when the action was triggered in another
notification the first notification was also (visually) removed (and
only until the notifications were fetched again from the server).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@SystemKeeper
Copy link

So the fact that I was seeing this only with 2 tabs and the message

Deferring notification refresh from browser storage are notify_push event to give the last tab the chance to do it

was just a coincidence?

@danxuliu
Copy link
Member Author

danxuliu commented Sep 6, 2023

So the fact that I was seeing this only with 2 tabs and the message

Deferring notification refresh from browser storage are notify_push event to give the last tab the chance to do it

was just a coincidence?

I was intrigued by that as well 🤷 Maybe there is something else, but at least I was able to reproduce the issue with a single tab and the steps above.

Copy link

@SystemKeeper SystemKeeper left a comment

Choose a reason for hiding this comment

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

I was unable to reproduce it the way you described in only one tab, but still this PR seems to fix the issue I was seeing.

Also it makes sense, because on dismissal the index is already there:

this.$emit('remove', this.index)

Copy link
Member

@Ivansss Ivansss left a comment

Choose a reason for hiding this comment

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

Tested and works 👍

@nickvergessen nickvergessen merged commit fe9589d into master Sep 18, 2023
19 checks passed
@nickvergessen nickvergessen deleted the fix-visually-removing-first-notification-when-executing-an-action branch September 18, 2023 15:11
@nickvergessen
Copy link
Member

I guess we backport till 25?

@danxuliu
Copy link
Member Author

I guess we backport till 25?

That was what I was counting on the backportbot to do. Of course it would have helped if I have called it... 🤦

@danxuliu
Copy link
Member Author

/backport to stable27

@danxuliu
Copy link
Member Author

/backport to stable26

@danxuliu
Copy link
Member Author

/backport to stable25

@backportbot-nextcloud
Copy link

The backport to stable27 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable27
git pull origin stable27

# Create the new backport branch
git checkout -b fix/foo-stable27

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable27

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@backportbot-nextcloud
Copy link

The backport to stable26 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable26
git pull origin stable26

# Create the new backport branch
git checkout -b fix/foo-stable26

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable26

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@backportbot-nextcloud
Copy link

The backport to stable25 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable25
git pull origin stable25

# Create the new backport branch
git checkout -b fix/foo-stable25

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable25

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@danxuliu
Copy link
Member Author

Oh, the irony... I will manually do the backports then.

@nickvergessen
Copy link
Member

Well compiled assets, so it's expected

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

Successfully merging this pull request may close these issues.

4 participants