[PR #4326] [MERGED] Fix MediaProgress not using the lastUpdate time sent for local progress syncs #4216

Closed
opened 2026-04-25 00:18:50 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4326
Author: @advplyr
Created: 5/23/2025
Status: Merged
Merged: 5/23/2025
Merged by: @advplyr

Base: masterHead: fix_mediaprogress_updatedat


📝 Commits (1)

  • 6d1f0b2 Fix MediaProgress not using the lastUpdate time sent for local progress syncs

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 server/models/MediaProgress.js (+2 -1)

📄 Description

Brief summary

When a local playback session is synced the lastUpdate time should be set on the media progress object to the same value. This way when comparing the timestamps for syncing they will be the same on the mobile device and server.

This was not working properly because Sequelize requires passing silent: true when saving.

Which issue is fixed?

I don't believe this is the underlying issue with progress syncing on mobile but if these timestamps are lined up it will be easier to debug.

I found this while testing local progress syncing: https://github.com/advplyr/audiobookshelf-app/issues/1510#issuecomment-2902671752

Note the log:
image

The progress was more recent on the server because of the bug being fixed in this PR. But you can see this was no problem because the currentTime on the server and the device were the same.

In-depth Description

For local playback sessions the lastUpdate time of the local playback session, local media progress and server media progress should all be the same after syncing.

How have you tested this?

I ran the same exact test outlined here https://github.com/advplyr/audiobookshelf-app/issues/1510#issuecomment-2902671752 and noted that the updated timestamps all line up now.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/4326 **Author:** [@advplyr](https://github.com/advplyr) **Created:** 5/23/2025 **Status:** ✅ Merged **Merged:** 5/23/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `fix_mediaprogress_updatedat` --- ### 📝 Commits (1) - [`6d1f0b2`](https://github.com/advplyr/audiobookshelf/commit/6d1f0b27df782b464de8cb3d04c51b02b34c91d5) Fix MediaProgress not using the lastUpdate time sent for local progress syncs ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/models/MediaProgress.js` (+2 -1) </details> ### 📄 Description <!-- For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details. If you do not follow this template, the PR may be closed without review. Please ensure all checks pass. If you are a new contributor, the workflows will need to be manually approved before they run. --> ## Brief summary When a local playback session is synced the `lastUpdate` time should be set on the media progress object to the same value. This way when comparing the timestamps for syncing they will be the same on the mobile device and server. This was not working properly because Sequelize requires passing `silent: true` when saving. ## Which issue is fixed? I don't believe this is the underlying issue with progress syncing on mobile but if these timestamps are lined up it will be easier to debug. I found this while testing local progress syncing: https://github.com/advplyr/audiobookshelf-app/issues/1510#issuecomment-2902671752 Note the log: ![image](https://github.com/user-attachments/assets/f29c3750-e55c-42b0-9b51-f02489ef2133) The progress was more recent on the server because of the bug being fixed in this PR. But you can see this was no problem because the `currentTime` on the server and the device were the same. ## In-depth Description For local playback sessions the `lastUpdate` time of the local playback session, local media progress and server media progress should all be the same after syncing. ## How have you tested this? I ran the same exact test outlined here https://github.com/advplyr/audiobookshelf-app/issues/1510#issuecomment-2902671752 and noted that the updated timestamps all line up now. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:18:50 +02:00
adam closed this issue 2026-04-25 00:18:51 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4216