hackage-server icon indicating copy to clipboard operation
hackage-server copied to clipboard

Move uploader out of acid-state

Open Kleidukos opened this issue 8 months ago • 4 comments

Follow-up of #1375 to use a Map rather than storing usernames in acid-state.

Since the datatype used for storage no longer reflects the shape of the API payload, I made a separate DTO for it.

Kleidukos avatar May 12 '25 20:05 Kleidukos

@gbaz I'm still unclear on how to initialise the Map and keep it updated. Shall we pass it in a TVar, and update it in the upload endpoint? Again, I'm very unfamiliar with the usual patterns of this project, but I'm willing to learn! :)

Kleidukos avatar May 12 '25 20:05 Kleidukos

@gbaz I'd be grateful if you could help me put the last pieces of the puzzle together, when time permits. :)

Kleidukos avatar May 22 '25 17:05 Kleidukos

ok i think i see the confusion. what i mean is why do we need any acid-state for any of this? can't we just compute it on the fly? before i had suggested a better way to cache, but i don't think we need to cache it either. hitting these endpoints should be rare, and all the data is available to query elsewhere. I think we shouldn't need acid-state specific to back this json endpoint at all, much less to migrate it.

gbaz avatar May 25 '25 23:05 gbaz

@gbaz ok then I must be mis-understanding the role of acid-state. In my head it's the one source of truth to fetch persistent data related to the index, including who has uploaded what. If the data isn't coming from acid-state, where does it come from?

Kleidukos avatar May 27 '25 10:05 Kleidukos