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

Delete track from playlist does not refresh page with new information #3651

Closed
erezschatz opened this issue Nov 12, 2023 · 5 comments
Closed

Comments

@erezschatz
Copy link

Description

Describe the bug

In a playlist page, click on "delete track" does delete the track from the playlist, but the page is not refreshed once the response arrives from the server and the information is not displayed until the user refresh the page manually.

To reproduce

Steps to reproduce the behavior:

  1. Go to a playlist page (e.g. /#playlist.php?action=show&playlist_id=57)
  2. Click on delete next to any track in the list (red X button)
  3. Page does not respond, no change is shown
  4. Reload page, change appears.

Expected behavior

Once the response from the server arrives, the page should refresh and show the new list minus the deleted songs.

Environment

  • Ampache version: 6.1.0 build 6da4547.
  • Web server + version: Apache/2.4.52 (Ubuntu)
  • Server operating system: Ubuntu 22.04.3 LTS
  • Client operating system: Mac OSx 13.6.1 (22G313)/Arch Linux
  • Tested on Safari/Firefox on Mac, Firefox on Linux

Client type

  • Web

Logs

Request example POST https://.../server/ajax.server.php?page=playlist&action=delete_track&playlist_id=57&track_id=82483
Response was 200 with the full XML to replace the current page.

Actual logs:

2023-11-12T09:41:15+00:00 [ampache] (Ampache\Module\System\Dba) -> Database connection...
2023-11-12T09:41:15+00:00 [ampache] (Ampache\Module\System\Dba) -> Database connection...
2023-11-12T09:41:15+00:00 [erez] (Ampache\Module\System\Session) -> vqkp34cc7jgaofih5md2sgid00 has been extended to Sun, 12 Nov 2023 10:41:15 +0000 extension length 3600
2023-11-12T09:41:15+00:00 [erez] (ajax.server) -> Called for page: {playlist}
2023-11-12T09:41:15+00:00 [erez] (Ampache\Repository\Model\Playlist) -> Delete item_id: 82483 from 57
2023-11-12T09:41:16+00:00 [erez] (Ampache\Repository\Model\Browse) -> show_objects called. browse {8} type {playlist_media}
2023-11-12T09:41:16+00:00 [erez] (Ampache\Module\System\Session) -> Writing to vqkp34cc7jgaofih5md2sgid00 with expiration 1699785676
usox added a commit to usox/ampache that referenced this issue Nov 12, 2023
The action builds a new browse instance having a higher id than the original browse instance.
This is the reason why the UI item cannot be updated with the content of the response.

Related to ampache#3651
@usox
Copy link
Contributor

usox commented Nov 12, 2023

Seems like the response is generated correctly but cannot be inserted into to UI-item...

@lachlan-00
Copy link
Member

that pull should definitely be updating that current browse with the new list now.

@usox
Copy link
Contributor

usox commented Nov 13, 2023

@erezschatz c0148cd should help with that.

@lachlan-00 fyi This could also be a problem within LocalPlay playlists (I found similar code there), but I wasn't able to test it.

@erezschatz
Copy link
Author

I just pulled the latest commits and can attest that it solved the issue

@lachlan-00
Copy link
Member

confirming on localplay and fixed now as well

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

No branches or pull requests

3 participants