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

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

Closed
Torstein-Eide opened this issue Jul 16, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Torstein-Eide
Copy link
Contributor

Torstein-Eide commented 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

@nichwall
Copy link
Contributor

nichwall commented 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

@advplyr advplyr added the awaiting release Issue is resolved and will be in the next release label Jul 27, 2024
Copy link

github-actions bot commented Aug 4, 2024

Fixed in v2.12.0.

@github-actions github-actions bot closed this as completed Aug 4, 2024
@github-actions github-actions bot removed the awaiting release Issue is resolved and will be in the next release label Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants