Skip to content

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

@amitt001

Description

@amitt001

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions