Add ability to read events from the IRS Attempts API#6375
Conversation
zachmargolis
left a comment
There was a problem hiding this comment.
LGTM, small comments
app/services/analytics_events.rb
Outdated
There was a problem hiding this comment.
the logs are JSON, to save ourselves a JSON parse later, should this just be the JSON array or hash or whatever?
Also is this accepting data wholesale from partners into our logs? I'm a little wary of giving partners freeform access to write to our logs because PII may end up there
There was a problem hiding this comment.
Hmm, yeah I hadn't considered PII but was nervous about just dropping stuff in here. Not super sure how to approach it cause I imagine we do want to be able to see these errors.
There was a problem hiding this comment.
no need to change, this is just me thinking aloud... as we've migrated other events to the new typed AnalyticsEvents, we've been checking for strings ex
expect().to receive(:track_event).with('The String Key', value: 1)
or the
expect(analytics).to have_logged_event('string key', value: 1)
but maybe this works just as well? Do we have a preference we should aim for?
There was a problem hiding this comment.
I forgot about have_logged_event which I think I actually like a little bit better.
There was a problem hiding this comment.
if we switch the let to let!( we can let Rspec eager load these and simplify the before block:
| events_to_acknowledge | |
| events_to_render | |
| end | |
| let(:events_to_acknowledge) do | |
| end | |
| let!(:events_to_acknowledge) do |
There was a problem hiding this comment.
Okay, so this gets tricky because of the .clear_attempts! call in the before action. That runs after the let! block so the events get created and then immediately destroyed 😭
This commit adds an API that allows for reading and acknowledging events from the IRS attempts API. This API is based losely on [RFC 8936](https://datatracker.ietf.org/doc/html/rfc8936). Currently it does not recognize the `returnImmediately` param and always returns immediately. changelog: Upcoming Features, IRS Attempts API, The ability to acknowledge IRS attempts API events was added
ba92240 to
d4e5b73
Compare
This commit adds an API that allows for reading and acknowledging events from the IRS attempts API.
This API is based loosely on RFC 8936. Currently it does not recognize the
returnImmediatelyparam and always returns immediately.