-
Notifications
You must be signed in to change notification settings - Fork 226
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
Links do not expire #143
Comments
I finally managed to find an issue. Had to dig into the source code. It turns out that unexpired entries are filtered relative to the UTC time(assuming that ::Time.current.to_s(:db) returns time in UTC format). ::Time.now fixed an issue. Is it considered as a bug? Should i submit pr? |
Yes please, a PR with a failing test demonstrating the issue and a fix would be great. |
Hm, after looking at the PR, I don't think that's the problem. Do you see the problem if you use If the problem persists, can you post the output of |
Thanks for an answer. My apologies for a great delay. Well, problem still persists even after changing to Time.current. |
Ok, I think your problem is that there's no timezone set. In any case, you shouldn't mix |
I looked into |
To what value is it set? |
It's set to Moscow. Well, but what Time.current.to_s(:db) is supposed to output then? Does it output correct time irrespective of timezone one's country sticks to? I mean, in case if |
An example what is returned on my system: Time.current
# => Fri, 14 May 2021 10:28:07 CEST +02:00
Time.current.to_s(:db)
# => "2021-05-14 08:28:10"
Time.zone
# => #<ActiveSupport::TimeZone:0x00007ff33ff6bcf8 @name="Berlin", @utc_offset=nil, @tzinfo=#<TZInfo::DataTimezone: Europe/Berlin>> |
Coming in a bit late to the convo after reviewing @threadedstream's PR #144 It seems to me that this issue is that by converting to a string, you'd drop the timezone info. When that is passed to the db as a string, the db will assume the time info is in the db's timezone, which in the case of ThreadedStream is probably different to their application timezone. This difference results in the string being converted to a time some hours different than what was intended.
I have reviewed the PR and have made suggestions on how better to "prove" that this change fixes what it sets out to fix. Thanks again for the contribution. |
I apologize for a huge delay. @jpmcgrath, thank you very much for spending some time reviewing my pr. Upon analyzing the whole conversation, my thoughts led me to the state of dilemma. On one hand, i should fix the issues pointed out in pr, and on the other, just settle it all by tuning rails timezone settings(although it's already set to a proper value). Well, how do we solve such a conundrum? |
Here's the simple request responsible for generating expiry links,which simply delegates the work to shortener api.
However, when i head over to localhost:3000/<unique_id> endpoint, it redirects me to the facebook.com, although, for obvious reason, it shouldn't. What am i doing wrong?
The text was updated successfully, but these errors were encountered: