JavaScript Error: "TypeError: timestamps[i] is undefined" {file: "app://system.gaiamobile.org/js/notification_screen.js" line: 377}

RESOLVED FIXED

Status

Firefox OS
Gaia::System::Status bar, Utility tray, Notification
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: gerard, Assigned: gandalf)

Tracking

({regression})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
Reproduced after I have updated my dogfooding build:

> 09-25 15:50:17.058   321   321 E GeckoConsole: [JavaScript Error: "TypeError: timestamps[i] is undefined" {file: "app://system.gaiamobile.org/js/notification_screen.js" line: 377}]
> 09-25 15:50:17.058   321   321 E GeckoConsole: [JavaScript Error: "TypeError: timestamps[i] is undefined" {file: "app://system.gaiamobile.org/js/notification_screen.js" line: 377}]
> 09-25 15:50:17.058   321   321 E GeckoConsole: [JavaScript Error: "TypeError: timestamps[i] is undefined" {file: "app://system.gaiamobile.org/js/notification_screen.js" line: 377}]
> 09-25 15:50:17.058   321   321 E GeckoConsole: [JavaScript Error: "TypeError: timestamps[i] is undefined" {file: "app://system.gaiamobile.org/js/notification_screen.js" line: 377}]
> 09-25 15:50:17.058   321   321 E GeckoConsole: [JavaScript Error: "TypeError: timestamps[i] is undefined" {file: "app://system.gaiamobile.org/js/notification_screen.js" line: 377}]
> 09-25 15:50:17.058   321   321 E GeckoConsole: [JavaScript Error: "TypeError: timestamps[i] is undefined" {file: "app://system.gaiamobile.org/js/notification_screen.js" line: 377}]
> 09-25 15:50:42.008   321   321 E GeckoConsole: [JavaScript Error: "TypeError: timestamps[i] is undefined" {file: "app://system.gaiamobile.org/js/notification_screen.js" line: 377}]
> 09-25 15:52:34.328   321   321 E GeckoConsole: [JavaScript Error: "TypeError: timestamps[i] is undefined" {file: "app://system.gaiamobile.org/js/notification_screen.js" line: 377}]
> 09-25 15:52:34.328   321   321 E GeckoConsole: [JavaScript Error: "TypeError: timestamps[i] is undefined" {file: "app://system.gaiamobile.org/js/notification_screen.js" line: 377}]

I don't know the consequences. Seems to be coming from bug 1203348.
Flags: needinfo?(gandalf)
(Assignee)

Comment 2

3 years ago
Ugh, seems like my fault. Sorry!

Taking!
Assignee: nobody → gandalf
(Assignee)

Comment 3

3 years ago
:gerard-majax - do you have any STRs, or does it happen instantly?
Created attachment 8666042 [details] [review]
[gaia] zbraniecki:1208478-spelling-in-timestamp-formatting > mozilla-b2g:master
(Assignee)

Comment 5

3 years ago
Comment on attachment 8666042 [details] [review]
[gaia] zbraniecki:1208478-spelling-in-timestamp-formatting > mozilla-b2g:master

Tim, can you give ma a quick review of that?

I made a mistake in my update timestamp formatting code and the `i` variable was not pointing to the correct timestamp in an array.

This code switches that away from live array and properly uses forEach and fat arrow functions instead.
Flags: needinfo?(gandalf)
Attachment #8666042 - Flags: review?(timdream)
(Assignee)

Comment 6

3 years ago
Comment on attachment 8666042 [details] [review]
[gaia] zbraniecki:1208478-spelling-in-timestamp-formatting > mozilla-b2g:master

Trying  different reviewer to offload Tim a bit :)
Attachment #8666042 - Flags: review?(timdream) → review?(apastor)
Comment on attachment 8666042 [details] [review]
[gaia] zbraniecki:1208478-spelling-in-timestamp-formatting > mozilla-b2g:master

r=me with the console.log removed and a unit test verifying this change. Thanks!
Attachment #8666042 - Flags: review?(apastor) → review+
(Assignee)

Comment 8

3 years ago
Commit: https://github.com/mozilla-b2g/gaia/commit/83133b63021fe53d43c415b0eb2e791bc26509bf
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.