You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The business dashboard often fetches data before the Filer has finished processing a just-submitted filing, so the dashboard is out of date even though it was just loaded.
Similarly, the business dashboard sometimes fetches some data (eg, business object) that doesn't match other data (eg, ledger) because they are separate fetch calls and their state could have changed between the two calls.
Also, the business dashboard doesn't automatically update to show the latest state when a filing is processed in the background (eg, Change of Addresses, or Involuntary Dissolution, or Expiry of Limited Restoration, or any FE filing).
Example issues:
a business that was just dissolved might still display as active in the dashboard
a business that was just restored might still display as historical in the dashboard
a business that was just frozen might still display as usable in the dashboard
a business that was just unfrozen might still display as unusable in the dashboard
any filing that was just filed might not display at all in either To Do or Recently Filing History
any filing that was just filed might display as "filed and pending" even though it's actually now completed
Refreshing the dashboard (F5) usually syncs up the latest (now-updated) data, but users don't know to do that, or if and when they should do that, and this is not a good user experience.
It does not appear that Nuxt supports streaming (ie, persistent connection), but the useFetch function supports a "watch" option to automatically re-run the fetching function each time other reactive values (eg, a timestamp) change. This might simplify the data reload logic. Ref
The Nuxt "middleware" could potentially keep the dashboard data up to date from the server side but I'm not sure how that architecture works nor what its impacts are. (Possibly see Server Side Rendering.) Something similar to this may be implemented for the BRD in #25080.
Please give me your quick thoughts on the options above. This is something we really should have in place for our Jan 22 directed launch so it needs to be a quick implementation. (We could always improve/change it later.)
I'm thinking we go with Proposed Solution 1 (polling), because I think it's the easiest one to understand and implement at this time (as it fits cleanly into our existing REST calls). Thoughts? I want a decision by consensus by Jan 2 so we can start implementing something asap.
(Yes, this could have been a RFC, but it's not. Sorry.)
I am good with Solution 1 as long as we poll only when needed.
My suggestion is to check if business.lastModified < most_recent_filing.submittedDate then poll else no poll. In this way we don't need a new endpoint. This should handle most of the scenario's.
Couple of exception to this is if the most_recent_filing is in PENDING or in PAID status
PENDING -> PAID will not change lastModified field
if most_recent_filing is future effective (will not change lastModified field until the effectiveDate)
Probably add some kind of exponential back off strategy right after relevant user actions that may update info displayed on UI.
Yes, that's what I thinking of as well. Like every second for the first 10 seconds after loading, then once a minute for the first 10 minutes? Then once an hour from then on?
My suggestion is to check if business.lastModified < most_recent_filing.submittedDate then poll else no poll. In this way we don't need a new endpoint. This should handle most of the scenario's.
I haven't decided on this exactly, but I don't want to call the business endpoint often because I think it does a lot of work in the API (eg, computes allowable actions).
I was thinking that the FIRST call the UI should do is to fetch the "last change timestamp", and then fetch the timestamp again after loading business, tasks, filings, addresses, directors, anything else? If the second timestamp > first timestamp then reload everything; else delay according to backoff algorithm and then poll again..
An improvement would be to return an object of timestamps (one for each data object), so that the UI could reload just the updated data objects.
Performance consideration: there could be 1000 concurrent users, meaning up to 1000 calls per second to the Legal API (but due to exponential backoff it would be much less than that).
Yes, that's what I thinking of as well. Like every second for the first 10 seconds after loading, then once a minute for the first 10 minutes? Then once an hour from then on?
Sounds good to me.
I haven't decided on this exactly, but I don't want to call the business endpoint often because I think it does a lot of work in the API (eg, computes allowable actions).
One option is to call the slim version of business endpoint which will need to have the lastModified field added. It bypasses all the heavy checks mostly i think.
I don't really know what that field was actually used for as I don't think I saw any code that updates that field besides the initial creation of the business record.
With the latest PR Vysakh has added basically any filing that gets processed by the filer will update that business.lastModified. Not sure if that is sufficient. There will be some scenarios where you don't need a refresh as no data being displayed on the UI has changed...but I think we can live with that for now?
Is there any data that could change not as a result of a filing?
I can't think of any scenario where the data has changed and the UI doesn't need to be refreshed...? But if so then yeah, I think we can live with that.
A "simple" API solution was implemented that only tracks certain changes to the filings table. This will catch maybe 95% of the issues we've seen. For the following scenarios, the UI will not auto-refresh, so the user will see the old (now-outdated) data:
when a business' BN is updated in the background
when a To Do item has been filed and then payment completes in the background
when a Draft Continuation Authorization is approved by staff (in another session)
business comments may be out of date
notifications may be out of date
Should we come up with another way to do this (after MVP possibly) to get 100% functionality? Are you OK with the existing functionality?
Performance consideration: there could be 1000 concurrent users, meaning up to 1000 calls per second to the Legal API (but due to exponential backoff it would be much less than that).
Performance can be improved if LEAR was using block storage on PVC instead of file storage (Openshift default) or alternatively migrating to GCP (even faster database storage there).
Performance can be improved if LEAR was using block storage on PVC instead of file storage (Openshift default) or alternatively migrating to GCP (even faster database storage there).
Activity
severinbeauvais commentedon Dec 16, 2024
Proposed Solution 1 - polling for changes
Pros
Cons
Proposed Solution 2 - server event using persistent connection (websockets)
Pros
Cons
Proposed Solution 3 - gRPC
Ref: https://grpc.io/
Pros
Cons
Proposed Solution 4 - Nuxt Data Fetching
Ref: https://nuxt.com/docs/getting-started/data-fetching
It does not appear that Nuxt supports streaming (ie, persistent connection), but the
useFetchfunction supports a "watch" option to automatically re-run the fetching function each time other reactive values (eg, a timestamp) change. This might simplify the data reload logic. RefThe Nuxt "middleware" could potentially keep the dashboard data up to date from the server side but I'm not sure how that architecture works nor what its impacts are. (Possibly see Server Side Rendering.) Something similar to this may be implemented for the BRD in #25080.
severinbeauvais commentedon Dec 24, 2024
@hfekete @argush3 @vysakh-menon-aot @leodube-aot @kialj876 @thorwolpert @JazzarKarim @cameron-eyds @seeker25
Please give me your quick thoughts on the options above. This is something we really should have in place for our Jan 22 directed launch so it needs to be a quick implementation. (We could always improve/change it later.)
I'm thinking we go with Proposed Solution 1 (polling), because I think it's the easiest one to understand and implement at this time (as it fits cleanly into our existing REST calls). Thoughts? I want a decision by consensus by Jan 2 so we can start implementing something asap.
(Yes, this could have been a RFC, but it's not. Sorry.)
seeker25 commentedon Dec 24, 2024
leodube-aot commentedon Dec 27, 2024
Given the time constraints and simplicity I'm good with solution 1.
argush3 commentedon Dec 27, 2024
yeah, solution 1 sounds good.
Probably add some kind of exponential back off strategy right after relevant user actions that may update info displayed on UI.
vysakh-menon-aot commentedon Dec 27, 2024
I am good with Solution 1 as long as we poll only when needed.
My suggestion is to check if
business.lastModified < most_recent_filing.submittedDatethen poll else no poll. In this way we don't need a new endpoint. This should handle most of the scenario's.Couple of exception to this is if the most_recent_filing is in PENDING or in PAID status
argush3 commentedon Dec 27, 2024
@vysakh-menon-aot are you sure
business.lastModifiedis really updated?vysakh-menon-aot commentedon Dec 27, 2024
Its not. I created a PR for this now. bcgov/lear#3154
argush3 commentedon Dec 27, 2024
Awesome!
severinbeauvais commentedon Dec 27, 2024
Yes, that's what I thinking of as well. Like every second for the first 10 seconds after loading, then once a minute for the first 10 minutes? Then once an hour from then on?
I haven't decided on this exactly, but I don't want to call the
businessendpoint often because I think it does a lot of work in the API (eg, computes allowable actions).I was thinking that the FIRST call the UI should do is to fetch the "last change timestamp", and then fetch the timestamp again after loading business, tasks, filings, addresses, directors, anything else? If the second timestamp > first timestamp then reload everything; else delay according to backoff algorithm and then poll again..
An improvement would be to return an object of timestamps (one for each data object), so that the UI could reload just the updated data objects.
Performance consideration: there could be 1000 concurrent users, meaning up to 1000 calls per second to the Legal API (but due to exponential backoff it would be much less than that).
argush3 commentedon Dec 27, 2024
Sounds good to me.
One option is to call the slim version of business endpoint which will need to have the
lastModifiedfield added. It bypasses all the heavy checks mostly i think.Example GET business slim request:
severinbeauvais commentedon Dec 27, 2024
^^ OK, nice.
What possible data could change in the background (as a result of a new filing, or something else), and does
business.lastModifiedreflect that?argush3 commentedon Dec 27, 2024
I don't really know what that field was actually used for as I don't think I saw any code that updates that field besides the initial creation of the business record.
With the latest PR Vysakh has added basically any filing that gets processed by the filer will update that
business.lastModified. Not sure if that is sufficient. There will be some scenarios where you don't need a refresh as no data being displayed on the UI has changed...but I think we can live with that for now?severinbeauvais commentedon Dec 27, 2024
Is there any data that could change not as a result of a filing?
I can't think of any scenario where the data has changed and the UI doesn't need to be refreshed...? But if so then yeah, I think we can live with that.
vysakh-menon-aot commentedon Dec 27, 2024
We have 1 scenario. Updating BN update for new business
severinbeauvais commentedon Jan 2, 2025
@OlgaPotiagalova
A "simple" API solution was implemented that only tracks certain changes to the
filingstable. This will catch maybe 95% of the issues we've seen. For the following scenarios, the UI will not auto-refresh, so the user will see the old (now-outdated) data:Should we come up with another way to do this (after MVP possibly) to get 100% functionality? Are you OK with the existing functionality?
seeker25 commentedon Jan 3, 2025
Performance can be improved if LEAR was using block storage on PVC instead of file storage (Openshift default) or alternatively migrating to GCP (even faster database storage there).
severinbeauvais commentedon Jan 3, 2025
That's good to know. How can we capture this? @argush3 @vysakh-menon-aot @leodube-aot @chenhongjing