Caching of transaction notes?

Hey hi! :wave:

I’ve built a jawn that matches my OMNY (american equivalent of Oyster) transactions with Monzo transactions and updates the transactions notes via API so that all my contactless transit payments look nice and tidy on my feed, like this:

However, I noticed that transaction notes seemed to be cached, and not even an app restart (with the spinner and all) seems to update the notes on both iOS and Android. I had to log out and log back in to see updated notes on iOS, and clear the cache on Android. More annoyingly, on iOS, if you open a note that has content but is cached as blank, then tap the back button without editing anything, it clears whatever was in the note.

Is there a way around this that I’m not thinking of, or is this a limitation of how things a cached?

1 Like

Hey Melody, typically speaking the behaviour of the apps is

  • If local cache is empty (post login or cleared cache), fetch entire transaction history from the API
  • Else, fetch the last 20 days worth of transactions from the API (more if there might be transactions missing locally that are older than 20 days) and merge them into the local cache

So generally speaking I would expect notes added to transactions via the open API to only show up in the app without a full log out/in or cache clearing if they are added to transactions made in the last 20 days.

5 Likes

That helps a lot, thank you!

1 Like