Project

General

Profile

Actions

Task #1761

closed

Long polling for refresh role-request state

Added by Vít Švanda over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
High
Assignee:
Vít Švanda
Category:
UX
Target version:
Start date:
07/24/2019
Due date:
% Done:

100%

Estimated time:
Owner:

Related issues

Related to IdStory Identity Manager - Task #1909: Table: return removed show loading indicatorClosedRadek Tomiška10/22/2019

Actions
Related to IdStory Identity Manager - Defect #2900: When I login as other user, after short time IdM stops to respect rights of that user in its behaviorClosedRadek Tomiška08/03/2021

Actions
Actions #1

Updated by Vít Švanda over 4 years ago

  • Status changed from New to In Progress
Actions #2

Updated by Vít Švanda over 4 years ago

  • % Done changed from 0 to 30

Prototype implemented.

Actions #3

Updated by Vít Švanda over 4 years ago

  • Target version changed from Rhyolite (9.7.3) to Rhyolite (9.7.5)
Actions #4

Updated by Vít Švanda over 4 years ago

  • Target version changed from Rhyolite (9.7.5) to Rhyolite (9.7.6)
Actions #5

Updated by Vít Švanda over 4 years ago

I have problem with Spring DeferredRequest, in some random cases doesn't work (request is not correctly ended). I don't know why.

Actions #6

Updated by Vít Švanda over 4 years ago

Problem with DeferredResult is maybe bug in Spring when thread is created by tomcat. I try to some solutions, but I need more testing.

Actions #7

Updated by Vít Švanda over 4 years ago

  • Target version changed from Rhyolite (9.7.6) to Rhyolite (9.7.7)
Actions #8

Updated by Vít Švanda over 4 years ago

All changes are in the develop.
Tests created.
Documentations created too https://wiki.czechidm.com/devel/documentation/long-polling#see_more.
  • Table showloading is disabled now ;)

Merge commit:
https://github.com/bcvsolutions/CzechIdMng/commit/f43b5191a47b0aa8cffb571c7b2f92fb04174113

Actions #9

Updated by Vít Švanda over 4 years ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Vít Švanda to Radek Tomiška
  • % Done changed from 30 to 90
Actions #10

Updated by Radek Tomiška over 4 years ago

Actions #11

Updated by Radek Tomiška over 4 years ago

  • Status changed from Needs feedback to In Progress
  • Assignee changed from Radek Tomiška to Vít Švanda

This feature is awesome, mainly in synchronization is really nice. I did test and code review, here are my notes:

Functional:
- when quick button from dashboard is used for create the role request, then dashboard is shown after is request is sent to be executed - will be nice to have automatic reload on dashborad too (if it is doable).
- When automatic reload is turned off, then old refresh button can be shown to enable manual refresh.
- When ''ROLE_REQUEST_READ''permission is not given, ''403'' message is shown on identity detail - roles tab (i know, user role defined in wiki requires it, but ... :)).
- when long polling is disabled, then no request could be called to BE.
- when long polling is disabled, then toogle button should be hidden (+old refresh button can be shown) - now is rendered and is not possible too toogle on (without message why).
- on system detail on synchronization tab - new toogle button is missing (old refresh button is shown with animation is running).

Code review:
- BE: ''PARAMETER_MODIFIED_FROM'' constant should be moved into ''ModifiedFromFilter'' interface (+ javadoc missing).
- BE: Filter for ''ModifiedFromFilter'' can be implement as FilterBuilder => will work for all abstract entities + prevent DRY in toPredicates method (in ''DefaultIdmRoleRequestService'' is implemented a different way than in other places - but i think is correct, should be used on all places (e.g. ''LongPollingManager#getLastTimeStamp'' use the same logic)).
- BE: ''@Query'' annotation from spring repository is forgotten in ''DefaultSysSyncItemLogService#toPredicates''.
- BE: ''CheckLongPollingResult'' interface - javadoc is missing.
- BE: ''IdmIdentityController#checkUnresolvedRequests'' requires ''ROLE_REQUEST_READ'', but ''IDENTITY_READ'' is required too (by #getDto()).
- FE: ''IdentityRoles#_checkUnresolvedRequest'' - checkUnresolvedRequest should be called in setState callback (row 109).
- Doc: configuration property ''idm.pub.app.long-polling.enabled'' missing in documentation.

Actions #12

Updated by Vít Švanda over 4 years ago

Functional:
- Good idea, but I don't want developing this now (may be some dashboard long polling could be exist). This is good topic for presentation when quick button from dashboard is used for create the role request, then dashboard is shown after is request is sent to be executed - will be nice to have automatic reload on dashborad too (if it is doable).
- I agree, it is nicer now. When automatic reload is turned off, then old refresh button can be shown to enable manual refresh.
- I added check. When ''ROLE_REQUEST_READ''permission is not given, ''403'' message is shown on identity detail - roles tab (i know, user role defined in wiki requires it, but ... :)).
- Disable of the long polling should be feature could be used in extreme situation (may be never). This is reason why was implemented only on the BE. But OK for our users I implemented check on the FE too. When long polling is disabled, then no request could be called to BE. When long polling is disabled, then toogle button should be hidden (+old refresh button can be shown) - now is rendered and is not possible too toogle on (without message why).
- Yes, it was my intention using Switch button for trun off automatic refresh only on indentity-roles page first. But OK, I implemented this now. For prevent duplicating of code I created longpolling manager on the FE. It was very painful, because agendas are not same and I had many problems with states and requests, but now is done. on system detail on synchronization tab - new toogle button is missing (old refresh button is shown with animation is running).

Code review:
- Added BE: ''PARAMETER_MODIFIED_FROM'' constant should be moved into ''ModifiedFromFilter'' interface (+ javadoc missing).
- BE: Filter for ''ModifiedFromFilter'' can be implement as FilterBuilder => will work for all abstract entities + prevent DRY in toPredicates method (in ''DefaultIdmRoleRequestService'' is implemented a different way than in other places - but i think is correct, should be used on all places (e.g. ''LongPollingManager#getLastTimeStamp'' use the same logic)).
- Removed - good point :-), BE: ''@Query'' annotation from spring repository is forgotten in ''DefaultSysSyncItemLogService#toPredicates''.
- Doc added BE: ''CheckLongPollingResult'' interface - javadoc is missing.
- Authorization added. BE: ''IdmIdentityController#checkUnresolvedRequests'' requires ''ROLE_REQUEST_READ'', but ''IDENTITY_READ'' is required too (by #getDto()).
- I do not want wait to render, I need to send request ASAP. FE: ''IdentityRoles#_checkUnresolvedRequest'' - checkUnresolvedRequest should be called in setState callback (row 109).
- Property was in wiki for version 9.7., I moved it to current dev Doc: configuration property ''idm.pub.app.long-polling.enabled'' missing in documentation.

Done. Beware, I made many changes, especially on the FE! All changes are here:

https://github.com/bcvsolutions/CzechIdMng/commit/eb48f4d9152f92022f003fbc0ee526fd9656f254

Actions #13

Updated by Vít Švanda over 4 years ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Vít Švanda to Radek Tomiška
Actions #14

Updated by Radek Tomiška over 4 years ago

  • Status changed from Needs feedback to Resolved
  • Assignee changed from Radek Tomiška to Vít Švanda
  • % Done changed from 90 to 100

It's awesome, thx!

Actions #15

Updated by Radek Tomiška over 4 years ago

  • Status changed from Resolved to Closed
Actions #16

Updated by Radek Tomiška over 4 years ago

  • Related to Task #1909: Table: return removed show loading indicator added
Actions #17

Updated by Radek Tomiška over 2 years ago

  • Related to Defect #2900: When I login as other user, after short time IdM stops to respect rights of that user in its behavior added
Actions

Also available in: Atom PDF