Closed Bug 961620 Opened 10 years ago Closed 10 years ago

Pick activity sends the first picture taken instead of the last one

Categories

(Firefox OS Graveyard :: Gaia::Camera, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gerard-majax, Assigned: dmarcos)

Details

(Keywords: regression)

Attachments

(3 files, 1 obsolete file)

On gecko+gaia master running on a Nexus S, when using the pick activity to attach photos, if you decide to retake the picture and then select it, then the first picture that was taken will be sent instead of the last one.

Gecko: 6d2f301
Gaia: 9418328

STR:

0. Open SMS app
1. Tap attachment
2 [review]. Select photo
3. Take one picture
4. Discard it and take another
5. Select this new picture

Expected: Last picture taken appears in the MMS
Actual: First picture taken appears in the MMS
Attached video unable to reproduce it. (obsolete) —
Alexandre,

I cannot reproduce it with the STR mentioned at comment 0. I am using Inari with the master PVT 20140119040203. Is there anything I missed?

And I am not very sure about the step 4. Is the "discard it"  to use "replace image" to reselect one? Or to choose one image in gallery and go back to another? Or to use "remove image" and to add another one?
Flags: needinfo?(lissyx+mozillians)
It is "replace image".
Flags: needinfo?(lissyx+mozillians)
QA Wanted - Let's see if someone else can reproduce this.
Keywords: qawanted
You must use the activity exposed by the camera app, not the gallery one. Sorry for the wrong component.
Component: Gaia::Gallery → Gaia::Camera
Attached video retake doesn't work
Ok, I can reproduce it with Camera app. And the "discard" is to press "retake" button inside camera. The attached video shows this issue.
Attachment #8362441 - Attachment is obsolete: true
This issue reproduces on the buri 1.4 Build ID: 20140121040201

Gaia   e218d17ae7d01a81d48f833cd6fafb4e11b26cd8
SourceStamp cdc0ab2c0cba
BuildID 20140121040201
Version 29.0a1

This issue does not reproduce on the Buri 1.3 Build ID: 20140121004137

BuildID: 20140121004137
Gaia: 47049555282a9a01fb60d1e1421b57e2810c96f5
Gecko: 6f7dfe36ab6c
Version: 28.0a2
QA Contact: sparsons
This issue started to occur on the Buri 1.4 Build ID:20140110040206

Gaia   f400efc804366c7b7cf5476d1d5d325e6651ee71
SourceStamp 37516445a0b5
BuildID 20140110040206
Version 29.0a1

Last working Buri 1.4 Build ID: 20140109040203

Gaia   47206ac66b084c6f6c4503a3b10d0e0760df2b6f
SourceStamp 9409405e0739
BuildID 20140109040203
Version 29.0a1
Assignee: nobody → pdahiya
Debugged and issue is click on select after multiple retakes triggers multiple onSelectClick listeners that sends multiple post results to the activity. 
The previous listeners should be removed on retake. Attaching PR with the fix where redundant select and retake listeners are explicitly removed.

The PR also fixes the below error seen in logs
01-30 13:00:52.169 E/GeckoConsole(  886): [JavaScript Error: "TypeError: camera is undefined" {file: "app://camera.gaiamobile.org/js/main.js" line: 8384}]

Please review
Attachment #8368071 - Flags: review?(dmarcos)
Thanks a lot Punam. Your patch is good but I think our code is not that good. I created an alternative patch that fixes the bug and also implements a small refactor of the confirm view/controller. In the new code I avoid destroying and recreating the confirm view and removing/attaching events at each time that the user retakes a picture/video. I need Wilson's input on this.
Attachment #8368452 - Flags: review?(wilsonpage)
dmarcos: Comments on Github.
Just modified the PR so we lazily create the view, render and attach the events only once during the life of the confirm view/controller.
Flags: needinfo?(wilsonpage)
New PR that avoids modifing evt.js to pass the name of the event to the event handler.
Attachment #8368452 - Flags: review?(wilsonpage) → review+
Flags: needinfo?(wilsonpage)
Assignee: pdahiya → dmarcos
Thanks Diego for refactoring and fixing this issue, re-assigning the bug to you.
Landed in master:

https://github.com/mozilla-b2g/gaia/commit/cd07ce781c2d8ea6630f606ee8741b6a12b666fc
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
blocking-b2g: 1.4? → ---
Attachment #8368071 - Flags: review?(dmarcos)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: