Closed Bug 1093093 Opened 11 years ago Closed 11 years ago

Log shaking notification does not explain the reason of a save failure (like when the SD card is in use), shows "[object Object]"

Categories

(Firefox OS Graveyard :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(b2g-v2.2 affected)

RESOLVED FIXED
2.1 S8 (7Nov)
Tracking Status
b2g-v2.2 --- affected

People

(Reporter: jlorenzo, Assigned: gerard-majax)

References

Details

(Whiteboard: [systemsfe])

Attachments

(2 files, 1 obsolete file)

STR 1. Enable shake to log 2. Plug a USB cable and activate USB storage 3. Shake it up! Expected results Like when you try to save a screenshot when the memory card is in use, you should see the reason of the failure. Actual "The logs could not be saved [object Object]". See attached screenshot for details
Assignee: nobody → lissyx+mozillians
QA Contact: lissyx+mozillians
On this specific case, we have an error coming from Gecko: > 11-04 14:59:41.208 2440 2440 I GeckoDump: LogShake: handling event capture-logs-error > 11-04 14:59:41.208 2440 2440 I GeckoDump: LogShake: handling capture logs error > 11-04 14:59:41.208 2440 2440 I GeckoDump: LogShake: Error is: object > 11-04 14:59:41.208 2440 2440 I GeckoDump: LogShake: Error: error.operation=makeDir > 11-04 14:59:41.208 2440 2440 I GeckoDump: LogShake: Error: error.path=/storage/sdcard/logs > 11-04 14:59:41.208 2440 2440 I GeckoDump: LogShake: Error: error.unixErrno=30 > 11-04 14:59:41.208 2440 2440 I GeckoDump: LogShake: Error: error.stack= > 11-04 14:59:41.208 2440 2440 I GeckoDump: LogShake: Error: error.fileName=(unknown module) > 11-04 14:59:41.208 2440 2440 I GeckoDump: LogShake: Error: error.lineNumber=0 Johann/Janx, how would you expose this kind of error in the notification ? I don't see any simple way to do so.
Errno 30 is EROFS: File system is only accessible in read-only mode. In this case, it happens because the sdcard is mounted via UMS on the computer. Hence, /storage/sdcard/logs does not exist and /storage/sdcard/ is just a subdirectory of the / file system. This one is obviously ro mounted.
QA Contact: lissyx+mozillians
Confere comment 1 and comment 2.
Flags: needinfo?(jlorenzo)
Flags: needinfo?(janx)
I'd say don't provide details unless you can and they're useful info. In the case of comment 2, maybe: > The logs could not be saved > Operation makeDir failed If `error` always has an `operation` attribute it could be helpful. That or you write short messages for every Errno (e.g. 30 could be "SD card is read-only") but that sounds like a lot of work.
Flags: needinfo?(janx)
The screenshot feature already handles this kind of cases. Is it possible to share this part of code?
Flags: needinfo?(jlorenzo)
Summary: Log shaking notification does not explain the reason of a save failure (like when the SD card is in use) → Log shaking notification does not explain the reason of a save failure (like when the SD card is in use), shows "[object Object]"
Attached file Gaia PR (obsolete) —
WIP: First patch. That does the trick for the sdcard in UMS mode case.
Flags: needinfo?(jlorenzo)
This obviously lacks tests.
Tested with your patch, the error message is displayed. I love the fact that you can tap the notification to get a more detailed message. That feature doesn't exist for screenshot.
Flags: needinfo?(jlorenzo)
Attached file Gaia PR
Using the proper link ...
Attachment #8516742 - Attachment is obsolete: true
PR updated with tests: sending notification on error is covered for the new use cases. Let's add more tests for notification click handler, now.
Reworked tests and enabled the pending one for testing success notification click handler.
Added tests for all click handlers.
Comment on attachment 8516760 [details] [review] Gaia PR Jan, we need your stamping :)
Attachment #8516760 - Flags: review?(janx)
Comment on attachment 8516760 [details] [review] Gaia PR r+ with two remarks that I'll copy below: 1) As an afterthought, it wouldn't be too hard to show unix error names and messages for all errnos (e.g. 28 to "ENOSPC: No space left on device") see https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/errno-base.h Not sure we want to add and re-localize all unix error messages for the sake of it, so just suggesting. 2) In general, if you change localized strings, please also change their names, so that localizers can re-translate them. This change seems pretty subtle though, so I'll needinfo l10n before requesting you change the names. Francesco, do localizers need a string-name change for changes that: - don't change the string's meaning (e.g. "The logs could not be saved" to "Error while saving logs") - change punctuation (e.g. "Capturing logs ..." to "Capturing logṣ̣…") ?
Flags: needinfo?(francesco.lodolo)
Attachment #8516760 - Flags: review?(janx) → review+
(In reply to Jan Keromnes [:janx] from comment #14) > Comment on attachment 8516760 [details] [review] > Gaia PR > > r+ with two remarks that I'll copy below: > > 1) > As an afterthought, it wouldn't be too hard to show unix error names and > messages for all errnos (e.g. 28 to "ENOSPC: No space left on device") see > https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/errno- > base.h > > Not sure we want to add and re-localize all unix error messages for the sake > of it, so just suggesting. That's also my doubt: we could code all errno cases, but that's a lot of work, and I'm not sure it's useful. So for now, I prefer that we stick to just adding on a per-discovered basis. > $ errno --list Also gives a comprehensive list :) > > 2) > In general, if you change localized strings, please also change their names, > so that localizers can re-translate them. This change seems pretty subtle > though, so I'll needinfo l10n before requesting you change the names. > > Francesco, do localizers need a string-name change for changes that: > - don't change the string's meaning (e.g. "The logs could not be saved" to > "Error while saving logs") > - change punctuation (e.g. "Capturing logs ..." to "Capturing logṣ̣…") > ? Forgot this, I'll wait feedback from l10n people.
It's on the edge, but in this specific case I'd change the IDs to make sure that localizers check their existing strings (also noted a typo on "occured"). > logsOperationFailed = Operation {{operation}} failed. So, what are the possible values of {{operation}}? EPERM, ESRCH, etc.? Are these strings going to be displayed only in the log or exposed to users?
Flags: needinfo?(francesco.lodolo)
(In reply to Francesco Lodolo [:flod] from comment #16) > It's on the edge, but in this specific case I'd change the IDs to make sure > that localizers check their existing strings (also noted a typo on > "occured"). > > > logsOperationFailed = Operation {{operation}} failed. > So, what are the possible values of {{operation}}? EPERM, ESRCH, etc.? No, that's coming from the error object itself. One example is the one exposed in the test: mkdir. > > Are these strings going to be displayed only in the log or exposed to users? For now it's exposed in the notification. Since logshake is mostly useful for developpers, I thought it would be good to provide a bit more info/context.
Comment on attachment 8516760 [details] [review] Gaia PR Jan, Francesco, feedback? to assert you agree with the nits fixes.
Attachment #8516760 - Flags: feedback?(janx)
Attachment #8516760 - Flags: feedback?(francesco.lodolo)
Comment on attachment 8516760 [details] [review] Gaia PR Looks good to me l10n-wise
Attachment #8516760 - Flags: feedback?(francesco.lodolo) → feedback+
Comment on attachment 8516760 [details] [review] Gaia PR Fixes look good to me, but two remarks about your test: From your quote in comment 1, error.operation is actually "makeDir", not "mkdir". Why use 11 EAGAIN "Try again" as generic error, wouldn't errno 0 have done the job here? I ask because if we support 11 one day, it won't be the generic error anymore.
Attachment #8516760 - Flags: feedback?(janx) → feedback+
No, you're right.
Addressed. Previous try was green at https://treeherder.mozilla.org/ui/#/jobs?repo=gaia-try&revision=22df2f7343da, let's wait for the latest push to be.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [systemsfe]
Target Milestone: --- → 2.1 S8 (7Nov)
Depends on: 1095902
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: