Skip to content

fix(app): serialize privkeylock timestamps as RFC3339 - #655

Open
iamquang95 wants to merge 1 commit into
mainfrom
feat/fix-627-1
Open

fix(app): serialize privkeylock timestamps as RFC3339#655
iamquang95 wants to merge 1 commit into
mainfrom
feat/fix-627-1

Conversation

@iamquang95

Copy link
Copy Markdown
Collaborator

Fix "privkeylock: the two implementations can't see each other's locks" in #627

Metadata.timestamp was u64 unix seconds; charon writes Go time.Time (RFC3339). A shared --private-key-file-lock path gave a JSON decode error instead of "another charon instance may be running".

Switched to chrono::DateTime<Utc>, which serializes byte-identically to Go. The u64 format never shipped. Staleness compare is now sub-second, matching time.Since.

@emlautarom1 emlautarom1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

serializes byte-identically to Go

Not exactly since Go's serialization trims trailing zeros unlike chrono. Works either way, but it's not byte-identical.

The u64 format never shipped

It did though (we used this format so far).

Code looks good, the PR body might be a bit misleading though.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants