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

Link with an expiry time, shown as expired = False on dashboard even after expiry time #29

Open
amitt001 opened this issue Dec 2, 2018 · 0 comments

Comments

@amitt001
Copy link
Owner

amitt001 commented Dec 2, 2018

The pygmy application offers an option to create links that expire after some specific time. This works by attaching an expiry time(in minutes), which is a positive integer, to the link record in DB.

The expiry time of an URL is calculated by url creation time + expiry time and if it is less than the current time, the short link is considered expired and can't be used anymore. If a user is logged in, the dashboard will show this URL as either expired = True or False, depending on weather url was opened after it's expiry time or not. This is where the bug lies.

The reason why the dashboard doesn't have real-time knowledge about the state of URL is, the expiry value in DB is set if a call comes for URL after it has expired. There is no background job for marking the URL as expired.

How this issue can be fixed?
This can be fixed by checking the expiry of URL on the application level when building the response data for the dashboard. URL's can be marked as expired at this point and any subsequent call to dashboard doesn't need to make any more updates.

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

No branches or pull requests

1 participant