-
-
Notifications
You must be signed in to change notification settings - Fork 884
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
Fix time zone handling #3496
Fix time zone handling #3496
Conversation
done now |
This also needs changes to activitypub-federation: LemmyNet/activitypub-federation-rust#62 There is again now a future post on lemmy.world probably due to this issue: |
I'm def down for adding this, especially since it keeps everything in the UTC timezone. It will be a breaking change so it'll have to come with |
Ah, so that's what I'm missing. That said, why not just send all dates in ISO 8601 format directly? |
After this, they will. We don't manipulate the columns coming back from postgres, so UTC timestamp without timezone doesn't include timestamp info for the 8601 format. |
I published version |
I have the SQL format fixed in #3800 |
Most stuff should be fixed. I'll wait for #3800 then fix the rest of the CI |
Needs cargo fmt |
You can see the errors here: https://woodpecker.join-lemmy.org/repos/129/pipeline/1977/17
Maybe its the other way round and you need to replace +00:00 with Z |
Ah, I missed those somehow. I've replaced +00:00 with Z in the tests. Those two things should be equivalent in all ISO8601 parsers. |
I'm not sure why the federation tests are failing now.. doesn't really seem related but could be I guess |
Im seeing some errors in the api-test logs:
Dont think they are related but should still be fixed. To debug the failures you can edit Edit: The test case "Reply to a comment from another instance, get notification" does fail with |
You're right. I've updated the hot_rank function to take a timestamp with time zone. Note that I haven't really tested this change in general, I've just been relying on the compiler and tests to say if it's good. |
That should be enough, anyway we need to make some release candidates for testing before releasing the major version with this. Now you just need to resolve conflicts and it should get merged automatically. |
Hey all, just thought I would confirm this is indeed a breaking change. Due to the fact that the latest tag for the docker images got pointed at the beta releases, we inadvertently updated to beta.8 (which has these changes in it). Many (not all) 3rd party clients are now unable to access our instance. It would be nice if a communication campaign can happen so 3rd party devs will know they need to update their code to handle for this prior to 0.19 (and potentially sooner if any other instances make the mistake we did) |
Hey @lazyguru, thanks for the info. That's interesting, because I wouldn't expect this change to break much since it just means Lemmy now sends and receives timestamps with time zone included. So code that uses a normal ISO8601 date parser should work unchanged afterwards - with worst case an offset of a few hours. It would be interesting to hear which clients break exactly and how. |
The ones I know of for sure are Sync and Mlem. Memmy works fine |
@laurencedawson @EricBAndrews @mormaer @aeharding might be interested |
👀 Be very careful about upgrading to betas and RC's, you'll very likely end up with a broken database that you'll have to fix manually. |
Yes, the problem was that "latest" is pointed at the betas. IMO it should only ever be pointed at a "stable" release |
Let me know if there's anywhere in our docs where we use that latest tag, as that's potentially destructive. |
This was fixed for the next release of sync. As the "z" was missing previously sync added it before parsing the timestamp. Now it's added conditionally. |
I got updated to this beta too, because of the latest tag in docker compose and I wondered why the connect app doesn't work anymore. Second problem is with this release, I don't see the admin settings button anymore. I am admin in the database and I can access the adminpanel via /admin in the URL, but the button is gone |
The whole code base uses naive date time and TIMESTAMP WITHOUT TIME ZONE.
Now there's conversion issues appearing in federation where timezones are not handled correctly.
Using NaiveDateTime is ... naive? So this PR removes all instances of naive time and adds defined timezones to everything (usually Utc).
Now, no conversions are needed anymore.
The database migration is extensive but it is free (no rewrite needed) since PG 12.