Skip to content

Conversation

@DAcodedBEAT
Copy link

Users can safely delete links with a configurable recovery window, and a DeletedBy audit trail tracks who deleted each link. Soft-deletion can also provides a foundation for scaling golink across multiple instances (read: running golink as a tailscale service).

Changes

  • Soft-delete links with configurable retention before permanent removal
  • Undelete recovery at /.deleted endpoint
  • DeletedBy field tracks who deleted each link (visible in history)
  • Automatic schema migrations on startup - no manual migration steps needed
  • New CLI flags: -deleted-retention, -cleanup-interval

- Configurable soft-delete with retention periods
- Undelete recovery for accidentally deleted links
- DeletedBy audit trail tracking who deleted links
- Automatic schema migrations for old databases
- /.deleted endpoint for link recovery

The soft-deletion pattern provides a foundation for scaling golink across
multiple instances with active/passive or active/active deployments.

Signed-off-by: Arun Philip <[email protected]>
Copy link
Contributor

@mikeodr mikeodr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR and the idea.

There's a lot to unpack here:

  • Unused code
  • Unrelated changes
  • Repetitive test code

This PR isn't ready in its current state, please clean it up and simplify.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What or why did the SVG change? It's not called out in the commit description.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a bunch of formatting changes unrelated to the update here. Can you clean up the change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, I'm struggling to parse out formatting changes from updates.

)

// newTestDB creates a new SQLiteDB with a test clock for deterministic time control.
func newTestDB(t *testing.T, initialTime time.Time) (*SQLiteDB, *tstest.Clock) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is unused.

t.Errorf("db.LoadStats got %v, want %v", got, want)
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of these tests look repetitive they can be test case driven.
There is far too many sleeps here slowing up the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants