Opened 8 years ago

Last modified 9 months 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)

See also #481.

  • Implement Unit-Tests
  • Repair undo delete entry

Related to #86 + #480

Change History (17)

comment:1 Changed 8 years ago by westram

  • Description modified (diff)

comment:2 Changed 8 years ago by westram

Example impacts of broken "undo delete":

comment:3 Changed 8 years ago by epruesse

  • Owner changed from devel to epruesse
  • Status changed from new to _started

comment:4 Changed 8 years ago by epruesse

  • Description modified (diff)

Issue seems to occur only in the presence of registered callbacks.

comment:5 Changed 8 years ago by epruesse

Should this really wait until 6.1? The bug causes the DB 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 8 years ago by westram

  • Milestone changed from arb6.1 to arb6

No. But not necessarily rc1.

comment:7 Changed 8 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 bug

comment:8 follow-up: Changed 8 years ago by epruesse

It should trigger GB_CB_DELETED, I think, which it doesn't…

comment:9 in reply to: ↑ 8 Changed 8 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 bug… It should trigger GB_CB_DELETED, I think, which it doesn't…

Yes right, bug detected i guess :)

Wanted would be:

ActionAction-CBsUndo-CBs
createGB_CB_SON_CREATEDGB_CB_DELETE
deleteGB_CB_DELETEGB_CB_SON_CREATED
changeGB_CB_CHANGEDGB_CB_CHANGED

comment:10 Changed 8 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 DB 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: Changed 8 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 8 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 8 years ago by epruesse

  • Milestone changed from arb6 to arb6.1

comment:14 Changed 8 years ago by epruesse

added a unit test showing the broken behavior in r12391

comment:15 Changed 6 years ago by westram

  • Milestone changed from arb6.1 to arb6.2

comment:16 Changed 5 years ago by westram

  • Milestone changed from arb6.2 to arb6.x

Ticket retargeted after milestone deleted

comment:17 Changed 9 months ago by westram

  • Milestone changed from arb6.x to arb7.x

Milestone renamed

Note: See TracTickets for help on using tickets.