Closed Bug 633939 Opened 13 years ago Closed 13 years ago

Fix attachments

Categories

(addons.mozilla.org Graveyard :: Add-on Builder, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
Builder 0.9

People

(Reporter: zalun, Assigned: zalun)

Details

(Whiteboard: [ftw])

Sometimes attachments loads an old version of itself - it should never happen.
Switching to old revision displays the latest saved attachment
It is not an old version.
Attachments are not saving script blocks 

To reproduce (my test settings in brackets):
1. Create HTML attachment ('html/test.html')
2. Add script block (multiple lines) <script>any content</script>
3. Save
4. Reload the page
The other problem is that when attachment is changed and new instance is created - its new id is not returned. There is no problem with the modules as we identify them by a path

:andym suggested to add a some id_number for the attachment. it will become unique for a following pair: 

* revision.pk, 
* attachment.id_number

One can reproduce the issue with doing following (create a new package as it will get broken)
1.  Add attachment (js/test/js)
2.  Change its content
3.  Save
4.  Open revisions modal and click on one revision back
5.  Change the attachment and save
6.  Navigate to the latest revision (hard reload)
7.  Observe 2 attachments with the same name
8.  Delete one of these attachments
9.  Reload
10. Observe the resurrection of the attachment
Just wrote the test and it seems that the problem is actually in front-end.
https://github.com/mozilla/FlightDeck/commit/6aa71c6e2c16ad44467fea5fbf8230d8d160f196#L3R284
above (comment 3) is related the comment 1
Both issues are fixed 

Duplicate attachments:
https://github.com/mozilla/FlightDeck/commit/0cfe66d22007814330b12639977fbbcd9cd3eacc
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Verified. Works fine on https://builder-addons.allizom.org
Status: RESOLVED → VERIFIED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.