Closed Bug 508041 Opened 15 years ago Closed 12 years ago

rowCountChanged is passing wrong numbers in calendar list

Categories

(Calendar :: Calendar Frontend, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: Fallen, Unassigned)

Details

ssitter found the following while testing bug 507170:

###!!! ASSERTION: row count did not change by the amount suggested, check
caller: 'rowCount == mRowCount', file
e:/dev/comm-central/src/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp,
line 1917

WARNING: row count changed unexpectedly: 'mRowCount == rowCount', file
e:/dev/comm-central/src/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp,
line 2871


This probably means we are passing the wrong number to this.treebox.rowCountChanged() in the calendar-list-tree widget.
I think the error happens in the unifinder and not in the calendar list. Removing the calendar triggers removing the events from the unifinder. rowCountChanged is called in the following locations: http://mxr.mozilla.org/comm-central/search?string=rowCountChanged&find=/calendar/
Steps to Reproduce, Actual Results, Expected Results:
=====================================================

1) startup Sunbird with clean profile:
    console: CalendarList addCalendar() calls rowCountChanged(0, 1)
    console: Unifinder setItems() calls rowCountChanged(0, 0)

2) add 3 events (1A, 1B, 1C) to default calendar:
    console: Unifinder addItems() calls rowCountChanged(-1, 1)
    console: Unifinder addItems() calls rowCountChanged(0, 1)
    console: Unifinder addItems() calls rowCountChanged(1, 1)

3) add a second calendar and select it

    console: CalendarList addCalendar() calls rowCountChanged(1, 1)
    console: Unifinder setItems() calls rowCountChanged(0, 0)

4) add 3 events (2A, 2B, 2C) to second calendar:

    console: Unifinder addItems() calls rowCountChanged(2, 1)
    console: Unifinder addItems() calls rowCountChanged(3, 1)
    console: Unifinder addItems() calls rowCountChanged(4, 1)

--> unifinder content is 1A, 1B, 1C, 2A, 2B, 2C --> OK

5) remove the second calendar:

    console: CalendarList removeCalendar() calls rowCountChanged(0, -1)
    console: Unifinder removeItems() calls rowCountChanged(3, -1)
    console: Unifinder removeItems() calls rowCountChanged(4, -1)
    console: Unifinder removeItems() calls rowCountChanged(5, -1)

--> ###!!! ASSERTION: row count did not change by the amount suggested ...
--> WARNING: row count changed unexpectedly: 'mRowCount == rowCount' ...
--> unifinder content is 1A, 1B, 1C --> OK

6) sort unifinder by title

--> unifinder content is 2B, 1C, 1B --> NOT OK, expected is 1C, 1B, 1A
Stefan, how does this bug relate to bug 508320? Isn't this a duplicate?
Whiteboard: [feedback?]
I cannot reproduce this error anymore using the steps from comment 2 above with Lightning 2.1a1 (Build 20121011) in Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/19.0 Thunderbird/19.0a1 (Build 20121011220509).
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
Whiteboard: [feedback?]
You need to log in before you can comment on or make changes to this bug.