LearnNewsExamplesServices
Frontmatter
id6650
titleneo/examples/stateProvider/Table.mjs invokes onStoreLoad _twice_ ??
stateClosed
labels
bug
assigneestobiu
createdAtApr 15, 2025, 10:09 AM
updatedAtApr 15, 2025, 6:38 PM
githubUrlhttps://github.com/neomjs/neo/issues/6650
authorgplanansky
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 15, 2025, 10:51 AM

neo/examples/stateProvider/Table.mjs invokes onStoreLoad twice ??

Closed v8.43.1 bug
gplanansky
gplanansky commented on Apr 15, 2025, 10:09 AM

Running neo/examples/stateProvider/Table.mjs invokes onStoreLoad twice, hence createViewData is invoked twice. Shouldn't this only load once?

https://github.com/neomjs/neo/blob/42029c4405b6a5c1189fb5ad641672db584eccc1c/src/table/Container.mjs#L476

    onStoreLoad(data) {
        let me = this;

        if (me.rendered) {
            me.createViewData();

https://github.com/neomjs/neo/blob/42029c4405b6a5c1189fb5ad641672db584eccc1/src/table/View.mjs#L325

    createViewData() {
        let me                    = this,
            {selectedRows, store} = me,
            countRecords          = store.getCount(),
            i                     = 0,
            rows                  = [];

        for (; i < countRecords; i++) {     /////////   this 
            rows.push(me.createRow({record: store.items[i], rowIndex: i}))
        }
gplanansky added the bug label on Apr 15, 2025, 10:09 AM
tobiu assigned to @tobiu on Apr 15, 2025, 10:48 AM
tobiu referenced in commit b115bde - "neo/examples/stateProvider/Table.mjs invokes onStoreLoad twice ?? #6650" on Apr 15, 2025, 10:48 AM
tobiu
tobiu Apr 15, 2025, 10:51 AM

Hi @gplanansky,

Obviously it should not happen, although the vdom engine will catch it => no duplicate DOM manipulations.

I changed the store internally a bit: https://github.com/neomjs/neo/blob/dev/src/data/Store.mjs#L435

  • onConstructed() now triggers a slightly delayed load event, in case there is data.
  • so, beforeSetStore() inside the table container no longer needs to to this as well.
  • double-checked the grid, and it was already adjusted there.
tobiu closed this issue on Apr 15, 2025, 10:51 AM
tobiu referenced in commit 01b7f68 - "#6650 removed testing log" on Apr 15, 2025, 10:52 AM
gplanansky
gplanansky Apr 15, 2025, 6:38 PM

Thanks. Debugging a data app's event-triggered reload logic, which I use a lot, gets confounded if core store / table have their own bug. I could see the trace going through beforeSetStore, but didn't sort it out.