~whereswaldon/forest-go

fields: fix 32-bit time truncation

This commit fixes a problem that would incorrectly construct time.Time's on 32-bit
platforms by truncating the time value when casting to a uint.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
feat(orchard): synchronize cache access

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
feat(orchard): add query for replies after timestamp

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
fix: regenerate test keys with no expiration

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
feat(store): add escape hatch to get store from within Archive

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
Revert "fix(orchard): restrict Recent() to requested node type"

This reverts commit 42d741f66ed5ac5e6217d978e6a8b31fb4f0f415.

I believe that this commit was an erroneous fix that only covered up
the real problem addressed later. The real issue was dangling references
to nodes that should have been deleted.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
deps: switch to maintained bolt implementation

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
fix(orchard): properly delete child index records

Previously this only handled child records that were single entries,
not those with an associated bucket.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
feat(orchard): implement key deletion on index

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
fix: iterate with correct variable names

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
test: resume using unsafe to test

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
test: do not call equals on node expected to be nil

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
fix: delete nodes from all indicies in RemoveSubtree

This adds a helper method to the internal index type
to facilitate deleting values from a bucket thatmay have
stored the values within a subbucket. It uses this helper
to properly delete the nodes from all of the various indicies
that they are stored in within the db.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
fix: properly rename test data for further examination

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
test(store): ensure deleted nodes are truly gone

The orchard has a bug in which a deleted node can still appear in
some list output because the node wasn't removed from every index.
This adds tests for all store implementations to catch similar mistakes

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
feat(cmd/forest): add to-bolt-key subcommand
This makes it much easier to find nodes within boltbrowser
when debugging orchard.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
fix(orchard): restrict Recent() to requested node type

Without this change, Orchard.Recent() would return errors
whenever its age-based iteration processed a node of a
type other than the requested type. This alters the logic
to simply skip nodes of the wrong type.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
fix: copy bytes before deserializing
This prevents deserialized structures from retaining
pointers into memory owned by bbolt, which may choose
to recycle the memory outside of query transactions.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
39d3f098 — Jack Mordaunt 3 years ago
Signed-off-by: Jack Mordaunt <jackmordaunt@gmail.com>
c6c2fd1d — Jack Mordaunt 3 years ago
Signed-off-by: Jack Mordaunt <jackmordaunt@gmail.com>
Next
Do not follow this link