[Bug]: Shares, if timelimit is more then 23/24 days, it get removed after 1ms #2108

Closed
opened 2026-04-25 00:03:33 +02:00 by adam · 2 comments
Owner

Originally created by @Torstein-Eide on GitHub (Jul 16, 2024).

What happened?

If trying to make a shared link with more then 23 days it get autoremoved.

#1768

What did you expect to happen?

I would not get autoremoved before the day expsire

Steps to reproduce the issue

  1. Open share on audiobook
  2. generate one at 23 days, it should work.
  3. generate a new one at 25 days, it should fail.

Audiobookshelf version

2.11

How are you running audiobookshelf?

Debian/PPA

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

2024-07-16 08:27:12.044 INFO [ShareManager] Scheduled media item share "XXXXXXXX-61ca-4f26-9ea5-e3b9c17cd1a5" to expire in 2160002114ms
2024-07-16 08:27:12.045 INFO [ShareManager] Removing expired media item share "XXXXXXXX-61ca-4f26-9ea5-e3b9c17cd1a5"

Additional Notes

No response

Originally created by @Torstein-Eide on GitHub (Jul 16, 2024). ### What happened? If trying to make a shared link with more then 23 days it get autoremoved. #1768 ### What did you expect to happen? I would not get autoremoved before the day expsire ### Steps to reproduce the issue 1. Open share on audiobook 2. generate one at 23 days, it should work. 3. generate a new one at 25 days, it should fail. ### Audiobookshelf version 2.11 ### How are you running audiobookshelf? Debian/PPA ### What OS is your Audiobookshelf server hosted from? Linux ### If the issue is being seen in the UI, what browsers are you seeing the problem on? None ### Logs ```python 2024-07-16 08:27:12.044 INFO [ShareManager] Scheduled media item share "XXXXXXXX-61ca-4f26-9ea5-e3b9c17cd1a5" to expire in 2160002114ms 2024-07-16 08:27:12.045 INFO [ShareManager] Removing expired media item share "XXXXXXXX-61ca-4f26-9ea5-e3b9c17cd1a5" ``` ### Additional Notes _No response_
adam added the bug label 2026-04-25 00:03:33 +02:00
adam closed this issue 2026-04-25 00:03:33 +02:00
Author
Owner

@nichwall commented on GitHub (Jul 16, 2024):

After more research, it looks like it may be due to the maximum value for a 32-bit signed integer and that the expiration time is calculated based on milliseconds.

2^31 (signed integer) has a maximum value of 2,147,483,647 ms, or about 24.8 days.

Specifically, the setTimeout function uses a 32-bit data type. Sequelize and everything else seems to be handling the time correctly.
https://github.com/advplyr/audiobookshelf/blob/master/server%2Fmanagers%2FShareManager.js#L122-L125

@nichwall commented on GitHub (Jul 16, 2024): After more research, it looks like it may be due to the maximum value for a 32-bit signed integer and that the expiration time is calculated based on milliseconds. 2^31 (signed integer) has a maximum value of 2,147,483,647 ms, or about 24.8 days. Specifically, the `setTimeout` function uses a 32-bit data type. Sequelize and everything else seems to be handling the time correctly. https://github.com/advplyr/audiobookshelf/blob/master/server%2Fmanagers%2FShareManager.js#L122-L125
Author
Owner

@github-actions[bot] commented on GitHub (Aug 5, 2024):

Fixed in v2.12.0.

@github-actions[bot] commented on GitHub (Aug 5, 2024): Fixed in [v2.12.0](https://github.com/advplyr/audiobookshelf/releases/tag/v2.12.0).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2108