Skip to content
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

chore: create email_events_log view to access Hasura Event metadata #4211

Merged
merged 3 commits into from
Jan 27, 2025

Conversation

jessicamcinchak
Copy link
Member

@jessicamcinchak jessicamcinchak commented Jan 26, 2025

A quick followup to #4209

It's a pain to paginate through our Hasura event logs. We already parse out relevant metadata about our submission events to submissions_services_log (aka the "Submissions log" in the editor), this does the same for email events now.

No plans to expose this via the editor right now, but hopefully a handy tool for dev debugging in the meantime 👍

Copy link

github-actions bot commented Jan 26, 2025

🤖 Hasura Change Summary compared a subset of table metadata including permissions:

Tracked Tables (1)

- flow_id
- session_id
filter: {}
comment: ""
Copy link
Member Author

Choose a reason for hiding this comment

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

I matched "select" permissions to the submission_services_log view here - does this seem fine? Alternatively, can keep stricter until explicit plans to expose in editor. View does not include any personal user data like email address or payment details, only session ID.

Copy link
Contributor

Choose a reason for hiding this comment

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

Great question!

I'd favour not exposing it all until we need to - if it's intended to be for platform admins only lets capture that here 👍

If / when we come to exposing it, we set the right permissions then.

I'll checkout the demoUser / submission_services_log permissions just now - I would have expected that to have the normal demo user filter of "I can only select my own sessions" applied here.

Copy link
Contributor

Choose a reason for hiding this comment

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

PR here - #4212

Copy link
Member Author

@jessicamcinchak jessicamcinchak Jan 27, 2025

Choose a reason for hiding this comment

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

Yep makes sense - will rollback & keep as admin-select only

@jessicamcinchak jessicamcinchak changed the title chore: create email_events_log view for easier Hasura Event log summaries chore: create email_events_log view to access Hasura Event metadata Jan 26, 2025
@jessicamcinchak jessicamcinchak requested a review from a team January 26, 2025 09:02
Copy link

github-actions bot commented Jan 26, 2025

Removed vultr server and associated DNS entries

Copy link
Contributor

@DafyddLlyr DafyddLlyr left a comment

Choose a reason for hiding this comment

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

Great!

WHEN ((webhook_conf)::text ~~ '%/send-email/payment-expiry-agent"'::text) THEN 'Payment expiry - agent'::text
WHEN ((webhook_conf)::text ~~ '%/send-email/payment-reminder"'::text) THEN 'Payment reminder'::text
WHEN ((webhook_conf)::text ~~ '%/send-email/payment-reminder-agent"'::text) THEN 'Payment reminder - agent'::text
ELSE (webhook_conf)::text
Copy link
Contributor

@DafyddLlyr DafyddLlyr Jan 27, 2025

Choose a reason for hiding this comment

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

Great fallback to catch new templates or other issues.

The fact we have to parse this from here (but it's very useful information) suggests we should maybe consider capturing this more explicitly / pro-actively as an audit log when sending emails.

This is a really solid and practical solution though - love it 👍

- flow_id
- session_id
filter: {}
comment: ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Great question!

I'd favour not exposing it all until we need to - if it's intended to be for platform admins only lets capture that here 👍

If / when we come to exposing it, we set the right permissions then.

I'll checkout the demoUser / submission_services_log permissions just now - I would have expected that to have the normal demo user filter of "I can only select my own sessions" applied here.

o
Merge branch 'main' of github.com:theopensystemslab/planx-new into jess/email-events-log
@jessicamcinchak jessicamcinchak merged commit 8ea6987 into main Jan 27, 2025
12 of 13 checks passed
@jessicamcinchak jessicamcinchak deleted the jess/email-events-log branch January 27, 2025 08:24
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