FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects

Handle order of events, add soft delete and add valid_at

Merged Sebastiaan ten Pas requested to merge 33-valid-at into main

Part of #33 (closed)

Description

This MR adds the logic to ignore outdated events by looking at the valid_at that will be sent with each event.

Query parameters, request body or request header

#33 (comment 765820)

There were basically three options to send the valid_at to the API endpoint:

  • As query parameter
  • In the request body
  • As a request header

What is important is that it needs to play nicely with the OpenAPI specification and the OpenAPI client generator.

The first option I explored is the request body. This felt like the best option, given the fact we are already using a request body for our PUT requests. It turned out this is not an option that's possible, because it's unsupported by spectacular:

It's an old discussion, but at that point it was not supported by the OpenAPI specification. It is now:

https://github.com/OAI/OpenAPI-Specification/issues/1801

But there's no way in spectacular to get that working.

The second option I explored is adding it as a query parameter. That is something spectacular and OpenAPI allows. It's fairly simple to get this working and it works quite nicely. The added benefit is also that we split account data (request body) from event logic (query parameters).

I did not explore the request header, as I felt like the query parameters are better than the request header.

Edited by Sebastiaan ten Pas

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading