codeforpdx / PASS

PASS project - with HMIS module integration
MIT License
25 stars 24 forks source link

Bug 454: when clicking on message in inbox the state of the unread me… #460

Closed bingeboy closed 8 months ago

bingeboy commented 8 months ago

Message Badge Not Updating After Message Read

This PR:

Resolves #454 Added the React update to the <Messages /> page so the state will stay in sync with the podserver message read status for the inbox.

Video:

screen-recorder-mon-oct-23-2023-12-58-19.webm

Additional Context (optional):

How to test

  1. Login to podserver and navigate to the messages section
  2. send more than one message to a pod you have access to or yourself
  3. check that the count is on the message icon on the top right
  4. state should update once the podserver is updated

Issues needing discussion/feedback (optional):

1. Need to add test coverage... could be an additional issue

leekahung commented 8 months ago

Think we can change this PR into a draft for the time being if this is a WIP

leekahung commented 8 months ago

Hey @bingeboy. Just wanted to check up on the progress of this draft. Are you making any headways? Let me know if you need anything, I'll see what I can help out on.

bingeboy commented 8 months ago

@leekahung sry haven't had time to work since we spoke. I'm focusing on the issue today. I have the state updating based on the inbox unread value. I'm playing around with it more now and going to add a test. Feel free to pull the branch and try it out.

bingeboy commented 8 months ago

screen-recorder-mon-oct-23-2023-12-58-19.webm

@leekahung check this video. Sort of lags at times but that's seems to be when it's waiting for a response from the podserver

leekahung commented 8 months ago

@leekahung check this video. Sort of lags at times but that's seems to be when it's waiting for a response from the podserver

Yes, the lagging is due to the message being created to Solid (the message content itself and the Solid Thing) and send on Solid (to the recipient and a copy to your Outbox). How it's built now was not intended for rapid sending of message to one person. Simply one message at a time and waiting for a reply.

leekahung commented 8 months ago

Just pulled the branch up a short while ago. It looks like the feature to update the badge state is working great from what I saw.

Let me know if you think it'll be ready to review and change from WIP and draft.

Great work!

bingeboy commented 8 months ago

Updated for peer review.

bingeboy commented 8 months ago

Currently the test added checks that <Messages /> has rendered. The messages are not loading in the test so I'm trying to sort that out next.

bingeboy commented 8 months ago

Getting back at this today... had a few days dealing with some heavy machines being moved around my property. @timbot1789 no messages are loading on the page in the test. I believe that's related to the the mocked message object.

bingeboy commented 8 months ago

@timbot1789 hey @leekahung and I fixed all merge conflicts. I haven't had a chance to add more tests but should have them tomorrow or else will open another ticket if I run into any more issues as we discussed.

leekahung commented 8 months ago

@timbot1789 hey @leekahung and I fixed all merge conflicts. I haven't had a chance to add more tests but should have them tomorrow or else will open another ticket if I run into any more issues as we discussed.

Yeah, I'm good with leaving the unit test for the message badge in a follow-up PR if needed.

bingeboy commented 8 months ago

Since new tests will need review I'm going to squash & merge now