S
strek @harishkumar_s_s
Sunday, January 12, 2025 import

Tweet

> The way you solve that is by showing the old state from cache while refetching the current state there are multiple choices here some are: 1. the convo has long history and local has oldest history then the new chat replaces the entire screen 2. the convo has very less history so there are only 2/3 messages that are to be concatenated and rendered 3. the convo hasn't changed at all 1 > how do you want to handle first case? Is it fine if the all the messages on screen scrolls when all new datas are being rendered? There are multiple things here because we used to paginate chats. 2 > here also the user's current chat might scroll a bit if it has new chats 3 > in this case only what you told would work pretty well because there are no changes happening here TBH it depends on users as well. I'd prefer loader instead of all those re renders / scrolls happening in front of my eye but you prefer this instead of showing a loader so IG its fine. Im just throwing in cases that https://t.co/tEtvufv8Fu hasnt handled. when it handles all these cases it will become the bloated app it doesn't want to be. If it still becomes the cleaner version Im very happy because its a win win for the users! > You keep the input fields disabled & show a loading spinner next to the input to indicate that we used to do this only the messages would re render