listAttachedOAuthClients should use a server timestamp.
Categories
(Firefox :: Firefox Accounts, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox103 | --- | fixed |
People
(Reporter: markh, Assigned: szatmary.zoltan1222, Mentored)
Details
(Keywords: good-first-bug)
Attachments
(1 file)
In bug 1548404 we are changing listAttachedOAuthClients
to return the last access time of the client expressed as "days ago". This is landing using Date.now()
, but clock skew means this might be wrong. We should calculate this based on the timestamp in the server response.
Reporter | ||
Updated•5 years ago
|
Comment 1•5 years ago
|
||
Hey Mark,
I'm new here and would love to help out with this. Already have gone through bug 1548404 and the discussion that followed. Do you have any other pointers for me?
Reporter | ||
Comment 2•5 years ago
|
||
Hey Chaitanya, that's great news!
I assume you've already gone through https://developer.mozilla.org/en-US/docs/Introduction. The bug should be relatively easy, but it will be complicated by the structure of FxAccountsClient.jsm - you will probably want the attachedClients()
method to return all headers, from which you can parse an X-Timestamp header for the timestamp of the server - however, that uses the internal _request
method, which is used by many other functions which do not want the headers. So maybe something like a new _requestWithHeaders
method, which is called by _request()
(but which just ignores the headers) and attachedClients()
calls that. Or maybe _requestWithTimestamp
and do the timestamp parsing in that module? We'll also need some basic tests.
Good luck, and let me know if you get stuck!
Comment 3•5 years ago
|
||
Yes Mark, I have gone through the introductory resources. Just downloading the source and building as of now, but it sounds like adding another method might be a good fit for this problem.
Let me get back to you.
P.S. could you help me out with what kind of tests would be required for such a change?
Thanks.
Reporter | ||
Comment 4•5 years ago
|
||
I think modifying the test at https://searchfox.org/mozilla-central/rev/8bc24752246aeac8a9aed566cf1caccf88d97d11/services/fxaccounts/tests/xpcshell/test_accounts.js#1607 is probably enough (and would be necessary anyway!). We probably would want to fall back to a local time if the server didn't supply the correct header, so duplicating part of this test for that case might also make sense.
Comment 5•5 years ago
|
||
I will keep that in mind.
Had a small doubt, my OS(Parrot) is not supported by the bootstrap script can I just download the source and run /mach bootstrap
?
Reporter | ||
Comment 6•5 years ago
|
||
(In reply to Chaitanya Mittal from comment #5)
Had a small doubt, my OS(Parrot) is not supported by the bootstrap script can I just download the source and run
/mach bootstrap
?
I seriously doubt it :(
Comment 7•5 years ago
|
||
Hey Mark,
Hit some roadblocks on the way, sorry for the delay. I have downloaded the source through the mercurial bundle and init my local working repository. I am unable to build because the bootstrap is incomplete. I will let you know when I make progress.
Comment 8•5 years ago
|
||
(In reply to Mark Hammond [:markh] [:mhammond] from comment #2)
... method to return all headers, from which you can parse an X-Timestamp header for the timestamp of the server
From where do I get the timestamp of the server?
Reporter | ||
Comment 9•5 years ago
|
||
The response will have an X-Timestamp
header which is the server timestamp.
Assignee | ||
Comment 10•3 years ago
|
||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 11•3 years ago
|
||
Comment 12•3 years ago
|
||
bugherder |
Description
•