Closed
Bug 636917
Opened 15 years ago
Closed 15 years ago
Livemark only added to _livemarks array after anno has been added
Categories
(Firefox :: Bookmarks & History, defect)
Firefox
Bookmarks & History
Tracking
()
RESOLVED
FIXED
People
(Reporter: rnewman, Assigned: mak)
References
Details
(Keywords: regression, Whiteboard: [places-next-wanted])
Attachments
(1 file, 4 obsolete files)
|
3.03 KB,
patch
|
dietrich
:
review+
benjamin
:
approval2.0-
|
Details | Diff | Splinter Review |
This means that handlers for livemark annotations get the wrong answer from nodeIsLivemarkContainer when the livemark service has been loaded. Uh oh.
mak suggested "in the new bug add a note that we should check current views code since onItemAdded livemarks live update could fail".
This was discovered in the course of fixing Bug 387138.
| Assignee | ||
Comment 2•15 years ago
|
||
I made this along the weekend but forgot to attach it.
It's a pretty much safe change, with a dedicated test, since isLivemark is used both by internal code and by Sync, its reliability should be good.
Due to the above, I would appreciate approval too.
| Assignee | ||
Comment 3•15 years ago
|
||
This is actually a regression we made in 3.6
Blocks: 492796
Keywords: regression
| Assignee | ||
Comment 4•15 years ago
|
||
I attached random stuff :(
Attachment #516113 -
Attachment is obsolete: true
Attachment #516113 -
Flags: review?(dietrich)
Attachment #516115 -
Flags: review?(dietrich)
| Assignee | ||
Comment 5•15 years ago
|
||
Comment on attachment 516115 [details] [diff] [review]
real patch v1.0
bah, I should cleanup my patches queue sometimes...
Attachment #516115 -
Attachment is obsolete: true
Attachment #516115 -
Flags: review?(dietrich)
| Assignee | ||
Comment 6•15 years ago
|
||
ok, this should be the correct one :p
Attachment #516121 -
Flags: review?(dietrich)
| Assignee | ||
Comment 7•15 years ago
|
||
Actually, we are also not respecting the idl in get/setFeedURI, should throw if the id is not a livemark... This fixes that, so the check in setFeedURI is not needed (you can't set a feeduri to a folder to transform it to a livemark)
Attachment #516121 -
Attachment is obsolete: true
Attachment #516121 -
Flags: review?(dietrich)
Attachment #516227 -
Flags: review?(dietrich)
Comment 8•15 years ago
|
||
Comment on attachment 516227 [details] [diff] [review]
patch v1.1
> _createFolder:
> function LS__createFolder(aParentId, aName, aSiteURI, aFeedURI, aIndex) {
> var folderId = bms.createFolder(aParentId, aName, aIndex);
> bms.setFolderReadonly(folderId, true);
>
> // Add an annotation to map the folder id to the livemark feed URI
>+ this._lastCreatedLivemarkFolderId = folderId;
> ans.setItemAnnotation(folderId, LMANNO_FEEDURI, aFeedURI.spec,
> 0, ans.EXPIRE_NEVER);
also add a comment about why storing the id.
> try {
> this._getLivemarkIndex(aFolderId);
> return true;
> }
> catch (ex) {}
>+ // There is an edge case here, if a AnnotationChanged notification asks for
>+ // isLivemark and the livemark is currently being added, it is not yet in
>+ // the _livemarks array. In such a case go the slow path.
>+ if (this._lastCreatedLivemarkFolderId === aFolderId)
>+ return ans.itemHasAnnotation(aFolderId, LMANNO_FEEDURI);
> return false;
> },
why here instead of in _getLivemarkIndex?
> getFeedURI: function LS_getFeedURI(aFolderId) {
>+ this._ensureLivemark(aFolderId);
>+
what about side-effects in other code that doesn't expect this to throw?
(and same for setFeedURI)
i'm worried about making this change so late in the cycle.
| Assignee | ||
Comment 9•15 years ago
|
||
(In reply to comment #8)
> > try {
> > this._getLivemarkIndex(aFolderId);
> > return true;
> > }
> > catch (ex) {}
> >+ // There is an edge case here, if a AnnotationChanged notification asks for
> >+ // isLivemark and the livemark is currently being added, it is not yet in
> >+ // the _livemarks array. In such a case go the slow path.
> >+ if (this._lastCreatedLivemarkFolderId === aFolderId)
> >+ return ans.itemHasAnnotation(aFolderId, LMANNO_FEEDURI);
> > return false;
> > },
>
> why here instead of in _getLivemarkIndex?
the livemark is not yet in the _livemarks array. it cannot have a index.
> > getFeedURI: function LS_getFeedURI(aFolderId) {
> >+ this._ensureLivemark(aFolderId);
> >+
>
> what about side-effects in other code that doesn't expect this to throw?
>
> (and same for setFeedURI)
>
> i'm worried about making this change so late in the cycle.
the idl says we should throw, so I'm not worried by code that expect it to not throw.
Comment 10•15 years ago
|
||
(In reply to comment #9)
> > > getFeedURI: function LS_getFeedURI(aFolderId) {
> > >+ this._ensureLivemark(aFolderId);
> > >+
> >
> > what about side-effects in other code that doesn't expect this to throw?
> >
> > (and same for setFeedURI)
> >
> > i'm worried about making this change so late in the cycle.
>
> the idl says we should throw, so I'm not worried by code that expect it to not
> throw.
I'm referring to internal code that doesn't handle an exception when calling this, causing other fallout (regressions) because of that.
This change is not at all related to this bug. Please remove it from this patch and we can discuss it in a new bug.
| Assignee | ||
Comment 11•15 years ago
|
||
ok, fine for me!
| Assignee | ||
Comment 12•15 years ago
|
||
reduced patch, splitted the remaining part to bug 638412
Attachment #516227 -
Attachment is obsolete: true
Attachment #516227 -
Flags: review?(dietrich)
Attachment #516564 -
Flags: review?(dietrich)
Comment 13•15 years ago
|
||
Comment on attachment 516564 [details] [diff] [review]
patch v2.0
r=me, thanks!
Attachment #516564 -
Flags: review?(dietrich) → review+
| Assignee | ||
Comment 14•15 years ago
|
||
Comment on attachment 516564 [details] [diff] [review]
patch v2.0
Asking approval for this small fix.
Handles an edge case where isLivemark returns false when it should be true. it is important because isLivemark is used in most of our UI and now in Sync.
The fix is pretty much trivial, and comes with a dedicated test.
Attachment #516564 -
Flags: approval2.0?
Comment 15•15 years ago
|
||
Can you push to try, and re-request if it's green?
Updated•15 years ago
|
Attachment #516564 -
Flags: approval2.0?
| Assignee | ||
Comment 16•15 years ago
|
||
Linux just completed, others running
http://tbpl.mozilla.org/?tree=MozillaTry&rev=ab31bfa47738
| Assignee | ||
Comment 17•15 years ago
|
||
Comment on attachment 516564 [details] [diff] [review]
patch v2.0
retrying with green try results!
Attachment #516564 -
Flags: approval2.0?
Updated•15 years ago
|
Attachment #516564 -
Flags: approval2.0? → approval2.0-
Comment 18•15 years ago
|
||
Comment on attachment 516564 [details] [diff] [review]
patch v2.0
Too late, sadly.
| Assignee | ||
Updated•15 years ago
|
Whiteboard: [places-next-wanted]
Comment 19•15 years ago
|
||
Whiteboard: [places-next-wanted] → [places-next-wanted][fixed-in-cedar]
Comment 20•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: [places-next-wanted][fixed-in-cedar] → [places-next-wanted]
| Assignee | ||
Updated•10 years ago
|
Flags: in-testsuite? → in-testsuite+
You need to log in
before you can comment on or make changes to this bug.
Description
•