Opened 11 years ago
Last modified 3 years ago
#496 _started defect
Test and repair ARBDB Undo
Reported by: | epruesse | Owned by: | epruesse |
---|---|---|---|
Priority: | normal | Milestone: | arb7.x |
Component: | Library (DB) | Version: | SVN |
Keywords: | Cc: |
Description (last modified by epruesse)
Change History (17)
comment:1 Changed 11 years ago by westram
- Description modified (diff)
comment:2 Changed 11 years ago by westram
comment:3 Changed 11 years ago by epruesse
- Owner changed from devel to epruesse
- Status changed from new to _started
comment:4 Changed 11 years ago by epruesse
- Description modified (diff)
Issue seems to occur only in the presence of registered callbacks.
comment:5 Changed 11 years ago by epruesse
Should this really wait until 6.1? The causes the to become "corrupted". GB_read_pntr() never returns NULL as far as I can see, but it does after the undo/redo with callbacks.
comment:6 Changed 11 years ago by westram
- Milestone changed from arb6.1 to arb6
No. But not necessarily rc1.
comment:7 Changed 11 years ago by epruesse
Undoing a GB_create triggers a GB_CB_SON_CREATED on the parent. Is this "expected" behavior? It sounds like a …
comment:8 follow-up: ↓ 9 Changed 11 years ago by epruesse
It should trigger GB_CB_DELETED, I think, which it doesn't…
comment:9 in reply to: ↑ 8 Changed 11 years ago by westram
Undoing a GB_create triggers a GB_CB_SON_CREATED on the parent. Is this "expected" behavior? It sounds like a … It should trigger GB_CB_DELETED, I think, which it doesn't…
Yes right, detected i guess
Wanted would be:
Action | Action-CBs | Undo-CBs |
create | GB_CB_SON_CREATED | GB_CB_DELETE |
delete | GB_CB_DELETE | GB_CB_SON_CREATED |
change | GB_CB_CHANGED | GB_CB_CHANGED |
comment:10 Changed 11 years ago by epruesse
How about making the description match what the code is doing instead?
Like so:
- GB_CB_DELETE
- Triggered if the GBDATA* was destroyed.
- GB_CB_CHANGE
- Triggered if the GBDATA* contents where modified. In the case of GBCONTAINER this means a child was added or removed.
- GB_CB_SON_CREATE
- Removed. Add/remove operations on a container trigger CHANGED.
As far as I can see, that's what's happening anyway. We'd just remove the SON_CREATED. Since it is called on both add and remove, and since the CHANGE CB is also called always, the client code can stay the same.
Since it servces about the same purpose and has already seen some iterations, I've had a brief look at the inotify kernel API. Since the doesn't support rename or move operations and access isn't really useful to observe, the only worthwhile additions would be "changed_flags" and "recursive".
comment:11 follow-up: ↓ 12 Changed 11 years ago by epruesse
The GB_CB_SON_CREATED issue seems to be more recent. Older versions behave as expected. The malformed GBENTRY after undoing GB_delete while having a CB registered occurs as far back as I've been able to test.
comment:12 in reply to: ↑ 11 Changed 11 years ago by westram
Replying to epruesse:
The GB_CB_SON_CREATED issue seems to be more recent.
Please document with a small test (using some TEST_…_BROKEN). And how about a branch for this ticket?
Older versions behave as expected.
Do you have a revision number where it works?
The malformed GBENTRY after undoing GB_delete while having a CB registered occurs as far back as I've been able to test.
Yes, I also think this has been present for ages.
comment:13 Changed 11 years ago by epruesse
- Milestone changed from arb6 to arb6.1
comment:14 Changed 11 years ago by epruesse
added a unit test showing the broken behavior in r12391
comment:15 Changed 9 years ago by westram
- Milestone changed from arb6.1 to arb6.2
comment:16 Changed 7 years ago by westram
- Milestone changed from arb6.2 to arb6.x
Ticket retargeted after milestone deleted
Example impacts of broken "undo delete":