Urigo / WhatsApp-Clone-Tutorial

https://www.tortilla.academy/Urigo/WhatsApp-Clone-Tutorial

Home Page:https://tortilla.academy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tutorial step 8's step 5.1 is buggy

TVaakanainen opened this issue · comments

modify schema/resolvers.ts

Lines 36-37 create a pretty annoying bug.

const lastMessageId = chat.messages[chat.messages.length - 1];
const messageId = String(Number(lastMessageId) + 1);

So what happens here is that when using the tutorial app depending on scenario you're re-using IDs on "database". I can see this has already been fixed on https://github.com/Urigo/WhatsApp-Clone-Server , but the tutorial still has this bug

...or maybe this bug always was only on tutorial, couldn't find the exact commit which would show this bug getting fixed.

@TVaakanainen could you help me identify the commit where it has been fixed?
is it in a certain step?

@TVaakanainen you are right, that logic is broken.
I've fixed it and deployed a new version and added you to the contributors on the bottom of the README