Closed
Bug 740710
Opened 13 years ago
Closed 13 years ago
B2G SMS: Timezone offset sign is wrong
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
RESOLVED
FIXED
mozilla14
People
(Reporter: timdream, Assigned: kanru)
References
Details
Attachments
(1 file)
(deleted),
patch
|
philikon
:
review+
|
Details | Diff | Splinter Review |
When trying to send an SMS and send back one, the timestamp shown in log is hours into the future. Not a Gaia issue.
I/Gecko ( 2614): SmsDatabaseService: Going to store {"delivery":"sent","sender":null,"receiver":"+886912345678","body":"Hello!","timestamp":1332999591630,"id":11} I/Gecko ( 2614): SmsDatabaseService: Going to store {"delivery":"received","sender":"+886912345678","receiver":null,"body":"Hello back!","timestamp":1333057268000,"id":12}
It has been reported people on different timezone sees different offsets.
Gaia issue: https://github.com/andreasgal/gaia/issues/1074#issuecomment-4797291
Comment 1•13 years ago
|
||
It looks a lot like the timezone offset is added at least twice to the timestamp. I bet the RIL worker and/or the conversion of timestamp to Date object to timestamp to Date object is messing it up somewhere.
Blocks: b2g-sms
Summary: Received SMS has timestamp offsets hours into the future → B2G SMS: Timezone offset is added to timestamp at least twice
Reporter | ||
Comment 2•13 years ago
|
||
Yeah, good catch. the received message is 16 hrs and 76.37 seconds ahead of the sent message. 76.37 secs is reasonable typing time of mine during the manual test.
Assignee | ||
Comment 3•13 years ago
|
||
I'd like to look into this.
Reporter | ||
Comment 5•13 years ago
|
||
\O/
Assignee | ||
Comment 6•13 years ago
|
||
Need to rebase because bug 736697 touched here.
Attachment #612843 -
Flags: review?(philipp)
Comment 8•13 years ago
|
||
Comment on attachment 612843 [details] [diff] [review]
timezone offset sign is wrong
> // If the most significant bit of the least significant nibble is 1,
> // the timezone offset is negative (fourth bit from the right => 0x08).
>+ // localtime = UTC + tzOffset
>+ // so
>+ // UTC = localtime - tzOffset
s/so/therefore/
Yeah, good catch! Apparently I suck at math :)
r=me. I can address the small change above and push this fix. Thanks!
Attachment #612843 -
Flags: review?(philipp) → review+
Assignee | ||
Comment 9•13 years ago
|
||
(In reply to Philipp von Weitershausen [:philikon] from comment #8)
> Comment on attachment 612843 [details] [diff] [review]
> timezone offset sign is wrong
>
> > // If the most significant bit of the least significant nibble is 1,
> > // the timezone offset is negative (fourth bit from the right => 0x08).
> >+ // localtime = UTC + tzOffset
> >+ // so
> >+ // UTC = localtime - tzOffset
>
> s/so/therefore/
>
> Yeah, good catch! Apparently I suck at math :)
>
> r=me. I can address the small change above and push this fix. Thanks!
Yes, push it! :)
Comment 10•13 years ago
|
||
(In reply to Kan-Ru Chen [:kanru] from comment #6)
> Need to rebase because bug 736697 touched here.
Next time, please do this asap right after asking for review. That way it creates less churn when pushing the patch. Thanks!
Updated•13 years ago
|
Summary: B2G SMS: Timezone offset is added to timestamp at least twice → B2G SMS: Timezone offset sign is wrong
Comment 11•13 years ago
|
||
Assignee | ||
Comment 12•13 years ago
|
||
(In reply to Philipp von Weitershausen [:philikon] from comment #10)
> (In reply to Kan-Ru Chen [:kanru] from comment #6)
> > Need to rebase because bug 736697 touched here.
>
> Next time, please do this asap right after asking for review. That way it
> creates less churn when pushing the patch. Thanks!
Ah.. I was meant to rebase when the changes hit m-c. Thanks for you super fast review :)
Comment 13•13 years ago
|
||
(In reply to Kan-Ru Chen [:kanru] from comment #12)
> (In reply to Philipp von Weitershausen [:philikon] from comment #10)
> > (In reply to Kan-Ru Chen [:kanru] from comment #6)
> > > Need to rebase because bug 736697 touched here.
> >
> > Next time, please do this asap right after asking for review. That way it
> > creates less churn when pushing the patch. Thanks!
>
> Ah.. I was meant to rebase when the changes hit m-c.
Oh I see. They just hit m-c from inbound. That's fair.
Reporter | ||
Comment 14•13 years ago
|
||
@kanru, you are the man!
Comment 15•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
You need to log in
before you can comment on or make changes to this bug.
Description
•