rapidpro / casepro

Case management dashboard for RapidPro
BSD 3-Clause "New" or "Revised" License
21 stars 31 forks source link

CasePro no longer auto-refreshing #223

Closed JPow closed 6 years ago

JPow commented 7 years ago

Hey, I noticed in U-Partners, our message inbox no longer refreshes as it used too. Looks like something is broken - perhaps someone working on it can take a look.

rowanseymour commented 7 years ago

@projectmushroom @miltontony can you guys check on the refresh stuff you added in https://github.com/rapidpro/casepro/pull/220 ?

JPow commented 7 years ago

@projectmushroom @miltontony any updates please? We have a 3 hour live chat approaching.

JPow commented 7 years ago

@rowanseymour this bug is still an ongoing issue.

rowanseymour commented 7 years ago

@JPow is this effecting all workspaces or is there one in particular I can look at to see this problem happening?

rowanseymour commented 7 years ago

@JPow n/m I think I'm seeing it on Nigeria. Appears that the AJAX request to refresh the inbox sometimes times out so I'll see what we need to do to fix that.

JPow commented 7 years ago

@rowanseymour tx. Re ur earlier query, you should be able to see it on all partner pages. I've been looking at https://global.upartners.org/ and https://sierraleone.upartners.org/

rowanseymour commented 7 years ago

I've pushed changes for two problems I've identified with the refresh functionality: 1) the query for fetching messages with new actions and locks wasn't efficient on a large message table, and 2) the poll function in the inbox controller was setting before==after so it never returned any messages.

@JPow this is deployed to rapidpro.io so please confirm that it's working as expected

JPow commented 6 years ago

@rowanseymour just tested on global.upartners and its not working.

rowanseymour commented 6 years ago

@JPow noted - I'll look into that in next few days

rowanseymour commented 6 years ago

Have investigated and this appears to be due to message fetching being based on created_on, but messages not becoming fetchable until is_handled is set. Maybe we can add a Msg.handled_on field and use that for message searching (before and after filters)

rowanseymour commented 6 years ago

Alternatively maybe we can fetch messages based on before/after other message ids, rather than using a time windows.

rowanseymour commented 6 years ago

Fixed in #239

rowanseymour commented 6 years ago

@JPow can you check if this is fixed for you now on upartners.org?

JPow commented 6 years ago

@rowanseymour confirmed as fixed. Tx.