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

feat: create submission_services_log view #3144

Merged
merged 1 commit into from
May 15, 2024

Conversation

jessicamcinchak
Copy link
Member

@jessicamcinchak jessicamcinchak commented May 14, 2024

Creates a new view of submission & pay events - now exposing successful and failed events - more similar to what we log in #planx-notifications.

Here's a snippet of what this looks like running against an environment with submissions:
Screenshot from 2024-05-14 14-31-46

Next steps:

  • Query via frontend and update visual display in submissions log tab
  • Remove any views or outdated data structures associated with current implementation

Copy link

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

Tracked Tables (1)

select
session_id,
payment_id::text as event_id,
'Pay' as event_type,
Copy link
Member Author

@jessicamcinchak jessicamcinchak May 14, 2024

Choose a reason for hiding this comment

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

In the future we may want to expand this to more clearly distinguish 'Pay' & 'Invite to Pay' - but we know the latter is rarely used currently and all payment attempts will be captured here regardless of method.

created_at
from payment_status
where status != 'created'
and created_at >= '2024-01-01'
Copy link
Member Author

Choose a reason for hiding this comment

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

Is there any reason to query & display submissions prior to January 2024? This filter gives us a bit more consistency in event formatting & we could always look up submissions outside this timeframe on request.

Copy link
Contributor

Choose a reason for hiding this comment

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

Totally on board with keeping this filter in place - makes a whole lot of sense.

seil.created_at
from hdb_catalog.hdb_scheduled_events se
left join hdb_catalog.hdb_scheduled_event_invocation_logs seil on seil.event_id = se.id
where se.webhook_conf::text not like '%email/%'
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'm filtering out email events (reminders, confirmations, saves etc) - they'd be easy to add in the future if we want, but let's keep straightforward for now 👍

ae.*
FROM all_events ae
left join public.lowcal_sessions ls on ls.id = ae.session_id
WHERE ls.flow_id is not null
Copy link
Member Author

Choose a reason for hiding this comment

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

flow_id is null in older cases where we used to create send events on /draft or /preview routes - this filters those out & there's been a fix in place to not create events on those routes at all anymore.

Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively, could we remove those records which should not have been created?

Copy link
Member Author

Choose a reason for hiding this comment

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

Event logs will simply be cleaned up by scheduled data sanitation, right? Personally would like to avoid a manual removal of records - they were arguably created "correctly" at the time, so I don't see an issue with keeping the audit history of them!

@jessicamcinchak jessicamcinchak marked this pull request as ready for review May 14, 2024 12:34
@jessicamcinchak jessicamcinchak requested a review from a team May 14, 2024 12:34
@jessicamcinchak
Copy link
Member Author

Copy link

github-actions bot commented May 14, 2024

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.

Looks like a solid improvement 👍

created_at
from payment_status
where status != 'created'
and created_at >= '2024-01-01'
Copy link
Contributor

Choose a reason for hiding this comment

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

Totally on board with keeping this filter in place - makes a whole lot of sense.

ae.*
FROM all_events ae
left join public.lowcal_sessions ls on ls.id = ae.session_id
WHERE ls.flow_id is not null
Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively, could we remove those records which should not have been created?

@jessicamcinchak jessicamcinchak merged commit 1a73dcb into main May 15, 2024
12 checks passed
@jessicamcinchak jessicamcinchak deleted the jess/new-submissions-log-data branch May 15, 2024 08:40
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