New Data won't show(sometimes) in session that created it

I have a chat app with a ‘library’ section to organize stuff. I store the ‘chat header’ as a Chat thing, and each message as a Message thing.
When I create a new chat, the chat display section will show the chat header and messages.
However, when I create a 2nd chat, only the header information will show in the chat window, not the messages.
When I create a third one, it works perfectly again.
So ‘sometimes’ I cannot see the new messages I’ve created.

Now - before suggesting that I have mis-connected my messages. I can fix this problem by hitting ‘refresh’ on the browser, now all 3 work perfectly - I can magically see the second chat.

Even more interesting, if I log into the app in 2 tabs, after creating chat’s 1, 2 and 3 in one session, where I cannot see chat 2(I have not refreshed the tab yet) - if I just switch tabs, the 2nd tab can see and interact with all 3 perfectly. They are all there, and working and the data is correct.

Even more weird to me: when I look at my ‘chat details’ - I have a ‘total tokens’ - a brand new chat has zero, but since there is now 2 messages, the header shows the total tokes, but it still will not show the messages.

gpt suggests that my problem is cacheing of the ‘search for’ in my messages repeating group. I have put the ‘empty chat’ into the chat window before adding messages, so the first ‘search’ found nothing and that result is stubbornly cache’d? but the other session does not have it cached so it can see the chat.

it consistently works like a seesaw - the odd numbers work: 1,3,5 while the even number requests 2,4,6 cannot be seen in the session that created them.

Any ideas?
first image is the session that created ‘Second gpt test’.
second image is the ‘other tab sessoin’ that did not create it, but can see it.
Note: on the first screen shot, in the header of the chat it says ‘Second gpt test’ - so it has put the chat into that window.


are you getting the response from an api?

yes, I get the response, and it gets stored correctly - I can see it after I refresh the screen.

I seem to have this problem fixed by making the ‘search for messages’ include 2 extra conditions:
Created On > current date/time:+years:-10 and
Created On < current date/time:+minutes:10
So by telling it no messages older than 10 years old and no messages from the future - each ‘search’ is unique and therefore any cache/buffer is rejected as ‘not a match’ and it goes to get the actual updated data. This has solved the problem. I hate it, but it works.
Super frustrating, when I create any other objects other then ‘message’ they all show up immediately and everything else updates perfectly. It was only my chat messages that would often not show up even when I did the ‘show list in element’ with a fresh search for messages - that seems to also have looked at the buffer and found no messages for that ‘chat’.

This topic was automatically closed after 14 days. New replies are no longer allowed.