-
Notifications
You must be signed in to change notification settings - Fork 38
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
(backend) Feat/link audit #1910
Conversation
e7fa886
to
92ce3e0
Compare
b4ed746
to
dd6f013
Compare
just dropping a quick ack here that i've started reviewing this PR, but will need a bit more time after the dust settles to finish 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! PR looks functionally complete; i just have some minor nits you could consider addressing, and some things i'd to hear your thoughts on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! feel free to merge when ready~
Problem
We want to provide an audit trail for link creators, so that they can know who has changed what on their link, and when.
See Notion story for details on user journey.
We currently store this data in our
url_histories
table. We parse the url records and expose an endpoint for the frontend to retrieve the records.Solution
/api/link-audit
For authenticated query:
Returns: (JSON) HttpStatus 200 for success
changes
is an array of typechangeSets[]
Values:
'create', 'update'
'state','userEmail','longUrl'
Refer to Notion doc for technical design.
Tests
What tests should be run to confirm functionality?
Future work
Improving pagination
We use the simplest approach to pagination currently (via limit and offset). There are various ways to improve this:
ORDER BY id
rather than something likeORDER BY created_at
The rationale for these optimizations are documented in the Notion technical document - we can do these optimisations at a later date if we evaluate that this is a performance issue.