Skip to content

Conversation

@ekzyis
Copy link
Member

@ekzyis ekzyis commented Oct 22, 2025

Description

TODO

  • ✅ db schema
  • @anon as patient zero
  • ✅ infect somebody by zapping them as a zombie
    • ℹ️ even 1 sat or CC is enough
    • ✅ Apollo cache update
  • ✅ immunity if they have an item younger than X hours
    • ℹ️ I picked X = 8 but very easy to change
  • ✅ notify users when they got infected
    • ✅ normal notification
    • ✅ push notification
  • ✅ there is no cure
    • ℹ️ this didn't require any code haha
  • ✅ automatically infect anyone who has been inactive for 36 hours

Screenshots

2025-10-26-181531_597x65_scrot

Q&A Videos

q&a of infecting users as anon with QR codes, immunity, notifications

2025-10-26.18-07-56.mp4

q&a of p2p zaps

2025-10-26.20-17-44.mp4

cc zaps have also been tested but without video

Checklist

Are your changes backward compatible? Please answer below:

yes

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:

8, see videos

For frontend changes: Tested on mobile, light and dark mode? Please answer below:

n/a

Did you introduce any new environment variables? If so, call them out explicitly here:

no

Did you use AI for this? If so, how much did it assist you?

no


Note

Adds a zap-driven “infection” mechanic with time-based immunity, UI badge, in-app/push notifications, hourly inactivity infections, and corresponding DB/GraphQL/client updates.

  • Backend/Logic:
    • Add zap-driven infection flow in api/paidAction/zap.js (maybeInfectUser, isImmune, daysSinceHalloween), returning immune in ItemActResult and notifying via notifyInfected.
    • New constants: HALLOWEEN_IMMUNITY_HOURS, HALLOWEEN_INACTIVITY_TIMEOUT_HOURS.
  • DB:
    • Migration adds users.infected and new Infection table with relations to users and ItemAct; seed @anon as infected.
  • Worker:
    • New worker/halloween.js job to infect users inactive for HALLOWEEN_INACTIVITY_TIMEOUT_HOURS; scheduled hourly and wired in worker/index.js.
  • GraphQL:
    • Extend schemas: ItemActResult.immune, UserOptional.infected, new Infection notification type; update resolvers to surface infection notes and hasNewNotes checks.
    • Apollo cache updates: include Infection in possibleTypes and fragments.
  • Frontend/UI:
    • Show infected status badge (biohazard) in components/badge.js.
    • Add infection notification rendering in components/notifications.js.
    • On zap, optimistically pass immune and update cache to mark target user optional.infected when applicable (infectOnPaid).
  • Push Notifications:
    • Add notifyInfected in lib/webPush.js to send push on infection.
  • Assets:
    • Add svgs/biohazard.svg.

Written by Cursor Bugbot for commit 3578299. This will update automatically on new commits. Configure here.

@ekzyis ekzyis added the feature new product features that weren't there before label Oct 22, 2025
@ekzyis ekzyis marked this pull request as draft October 22, 2025 19:18
@BScoresby
Copy link

A few notes:

🚧 immunity if they have posted something in the last X hours

Posts and comments should count (lots of stackers rarely post), but maybe we should make the immunity shorter, so X = 6hrs?

🚧 start game at Oct 27/28

What if it started on Halloween? So 31 October at 00:00 and then we have the game play for 1 week into November?

It might be cool if we made a post announcing the winners (if any), but I'm not sure if there's a privacy implication there (are there stackers who would feel uncomfortable being highlighted this way?)

🚧 handle inactive / "hiding" stackers in some way

What if instead of having a few patient zeroes, we start the game by turning every account that hasn't posted or commented or zapped in the last 24 hours into a zombie?

Problem with this is that it might mean the game starts slow, so maybe we also add patient zeroes.

of course this doesn't solve a person hiding after that point. could a leaderboard be made? top > stackers > zombies? and it would show who is still not a zombie after the initial infection event?

@ekzyis
Copy link
Member Author

ekzyis commented Oct 22, 2025

Posts and comments should count (lots of stackers rarely post), but maybe we should make the immunity shorter, so X = 6hrs?

What I like about 8 hours is that it's the average time people sleep (or should sleep), but we can def make it more challenging. I will make sure that we can easily change this when I'm done with the implementation! Should literally just be changing a value.

What if it started on Halloween? So 31 October at 00:00 and then we have the game play for 1 week into November?

Okay with me! @huumn mentioned "at least 3 days before halloween, ideally earlier" to me though, not sure why

It might be cool if we made a post announcing the winners

Yeah I considered this too

What if instead of having a few patient zeroes, we start the game by turning every account that hasn't posted or commented or zapped in the last 24 hours into a zombie?

Problem with this is that it might mean the game starts slow, so maybe we also add patient zeroes.

Ohh, I like this! It at least partially handles inactive users: the ones inactive before the event even started.

Now we just need to handle users inactive after the game started as you mentioned

could a leaderboard be made?

This triggered vietnam flashbacks, haha

But yes, I think this is a valid idea, will consider it

@BScoresby
Copy link

vietnam flashbacks

I actually laughed outloud when I read this. MSM must have really been rough for you guys. I don't think there needs to be a leaderboard. We also discussed giving each stacker a countdown timer that was publicly displayed on their profile page.

What we want to avoid is a stacker who infrequently visits the site managing to win the game just because they're never here. This makes me think we need some way of surfacing who is vulnerable. A leaderboard is inelegant -- it means there is no hiding. We could also have a rolling timer for everyone where if a stacker does not post in 36 hours or some similar period they automatically become a zombie. This seems less fun, but perhaps the stackers who will be interested in playing are those who visit the site and comment/post at least once every few days.

at least three days before Halloween

I think that's my fault. I was envisioning it as something that culminated on Halloween, but it works just as good if it begins on Halloween.

8 hours

I agree that we don't want to be too aggressive, but then again, under eight hours actually makes it challenging. Maybe we stick with 8 hours, but if the game is fun, we could whip it out again at some point in the future and try it with a shorter immunity time.

@ekzyis ekzyis force-pushed the halloween branch 2 times, most recently from 86925dc to 88c08eb Compare October 22, 2025 22:34
@ekzyis
Copy link
Member Author

ekzyis commented Oct 23, 2025

We could also have a rolling timer for everyone where if a stacker does not post in 36 hours or some similar period they automatically become a zombie. This seems less fun, but perhaps the stackers who will be interested in playing are those who visit the site and comment/post at least once every few days.

I like this, sounds simple and effective

but then again, under eight hours actually makes it challenging.

Changing patient zero to @anon made me realize that it would be really hard for someone like me who is on SN all day to get infected unless I allow it and infect myself using @anon.

I don't think we should play—so we should infect ourselves using @anon when the game starts—but now I see that 8 hours is too easy.

I will change it to 6 hours!

This also handles users that have been inactive before the game even started the same. The timer starts for everyone at October 31.

@BScoresby
Copy link

I agree that it will be very hard for people who are highly active users to get infected. perhaps the timer could begin to shorten as we get closer to the end of the contest. I don't know how hard such a thing would be to implement, but it could go like this:

day 1: 8 hours
day 2: 7 hours
day 3: 6 hours
day 4: 5 hours
day 5: 4 hours
day 6: 3 hours
day 7: 2 hours

at which point I imagine pretty much everybody would be infected. Maybe that's too aggressive, but I like it being difficult.

perhaps if the rules are not widely known, we can settle for a 5 or 6 hour time limit and people will get picked off.

@ekzyis
Copy link
Member Author

ekzyis commented Oct 26, 2025

This would definitely be doable

I also wonder if the rules should be public actually so it's a more fair and thus interesting game

@ekzyis
Copy link
Member Author

ekzyis commented Oct 26, 2025

Immunity now lasts one hour less for every day since halloween, starting at 8 hours and until a minimum of 1 hour.

Like @BScoresby, I also think that this will make the game end within the first two weeks, if not the first.

@ekzyis ekzyis marked this pull request as ready for review October 26, 2025 17:50
cursor[bot]

This comment was marked as outdated.

@ekzyis ekzyis marked this pull request as draft October 26, 2025 18:00
@ekzyis ekzyis marked this pull request as ready for review October 26, 2025 19:21
@ekzyis
Copy link
Member Author

ekzyis commented Oct 26, 2025

I didn't fix the SVG alignment in the videos yet, but it's fixed now:

before:

2025-10-26-204651_1918x1177_scrot

after:

2025-10-26-204658_1918x1177_scrot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature new product features that weren't there before

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants