Lost my streak. I visited this place yesterday @Jamie Peak :( I was at 19. Now at 1. Nooo. Did I make a mistake?
I coded a little YouTube audio player. I hide the native player and get the album art. Using https://github.com/tjallingt/react-youtube. But I just learned about https://github.com/paulirish/lite-youtube-embed and might have to now convert it all again to make it better :P
Check the tweet to listen to the audio 🔊 https://twitter.com/Jonnotie/status/1757111146400927921
Thanks @Jamie Peak for the inspiration to build in a streak feature. It was a nice challenge and had to write a bunch of code that will come it very handy in the future.
This is awesome @Jonno Riekwel! Love the way you show the streak. I was considering like a GitHub commits heat map view for profiles, but left it out for now. It might be something I revisit after seeing your monthly view.
I also had a similar thing when building it, initially I thought it would be pretty easy to implement but quickly realised it wasn’t. 😅
Cheers! It makes sense, to add it as a completed habit. And it adds it as a new entry into the database whenever you login, so it just records it as any other "habit".
Oh nice, that sounds like a really nice way to handle it.
I had to go a different approach as sessions last around 3 months to avoid repeated logins. So I basically check when user visits if a streak has been added for the current day or not (should be in local timezone - as mentioned in the other post 😅), if not present streak is added, logic is done in the background to get the streak total and scripts run in the background multiple times a day to check if the streak is present for today/yesterday if none found it ends the streak.
Sounds complex but it actually isn't, I think it's probably the most efficient way to maintain ongoing streaks and end streaks accurately.
Yeah possibly 😅, I’m going to investigate though to make sure the logging is correct. I believe it is and it’s just a result of time zones which is frustrating, I’ll have a think on this! 🙌
No worries! I could be wrong though. I'm not 100% certain it was at 4 yesterday actually.
HA! It's 10pm here in NZ. and it went up to 5 from 4. So there's something funky going on with timezones.
Yeah, I think I've spotted the problem, I still need to test it but should have a fix for it out tomorrow! 🙌
Thanks again for the help with this.
I’ve managed to figure out the issue and have a fix ready to go. I’m just going to hold off on releasing until I’ve done a bit more testing, also want to make sure we don’t lose existing streaks. Should be live Friday all being well. Thanks again for the help tracking this down. 🙌
+1
2
1
Ahhh sorry I’ve found the issue. A weird duplicate I’ve not seen before on the streak broke the count. Don’t worry I’ll fix and bring your streak number back.
1
Yay! Thought I was crazy there for a second. Thanks :)
1
I think it happened again. I religiously visit everyday but it went to 1 again.
0