cardinalitypuzzles / cardboard

Dashboard for managing puzzles and tracking status during a puzzle hunt
MIT License
31 stars 21 forks source link

Refresh tags upon adding a puzzle #722

Closed kcaze closed 5 months ago

kcaze commented 6 months ago

Address #672.

This re-fetches the hunt slice after adding a puzzle, so the new meta tag appears.

rgossiaux commented 6 months ago

Does this fully fix the issue? I haven't tested it but from my understanding the tags are also missing when other people add metas (or if they create new tags in some other way)

I think we might want to just refresh the Hunt object periodically, like every 60s or so, similar to what we're doing with refreshing the puzzles. I think this change you're making to refresh it immediately after adding a puzzle is also good for the case when you add a meta and then immediately try to add a feeder puzzle to that meta, though we could check if it's a meta first as an optimization. For correctness we would also want to do an immediate refresh if you edit the puzzle to toggle whether it's a meta, I think.

kcaze commented 6 months ago

Yeah that makes sense. I'll add a periodic refresh and also a refresh when you edit tags.

kcaze commented 6 months ago

Tested editing a puzzle to change it to a meta and then change it to not a meta.

I opened two windows to test the periodic refresh for tags.

kcaze commented 6 months ago

Yeah that makes sense, I don't have a good sense of how much additional load fetching the hunt object is (since we already fetch puzzles every 10 seconds). From a perf standpoint, I guess ideally we have a websocket connection with which the server pushes updates?

It makes sense to me to merge the default tags from the hunt object + custom tags from the puzzles instead. I'll undo these changes and get tags that way.

kcaze commented 5 months ago

Closing in favor of #755.