Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CrudManager responding to failed remove requests should restore records from removed Bag #5684

Open
ExtAnimal opened this issue Nov 29, 2022 · 1 comment
Labels
bug Something isn't working forum Issues from forum large-account Reported by large customer

Comments

@ExtAnimal
Copy link

ExtAnimal commented Nov 29, 2022

Forum post

If the server responds to a sync request that contains

events : {
    removed : [{ id : 1 }, { id : 2}]
}

with a response that contains

events : {
    removed : [{ id : 1}]
}

The it should restore record id 2 from the Store's removed Bag.

The code in CrudManager does strange things. AbstractCrudManager.getRowsToApplyChangesTo collects respondedIds and if the responded ids do not contain all the ids that weer passed to the server in the remove block, it adds them back in.

So the server can never respond with a reply that tells the CrudManager it didn't manage to delete the records. If the server sends rows : [{ id <deleted record Id> }], the record will be considered an added record.

As it stands, I cannot see the store's removed Bag being processed at all. The removed records stay in there after the sync response.

This area needs some thorough testing using t.mockAjax.

@ExtAnimal ExtAnimal added bug Something isn't working forum Issues from forum large-account Reported by large customer labels Nov 29, 2022
@ExtAnimal
Copy link
Author

Failing test case added in this branch: https://github.com/bryntum/bryntum-suite/pull/6197

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum large-account Reported by large customer
Projects
None yet
Development

No branches or pull requests

1 participant