SynchronizationRequests can be created with non-unique ids
(MGNLSYNC-56)
|
|
| Status: | Completed |
| Project: | Magnolia Synchronization Module |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Sub-task | Priority: | Neutral |
| Reporter: | Roman Kovařík | Assignee: | Roman Kovařík |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Sprint: | Nucleus 10 |
| Team: |
| Description |
SynchronizationRequest req = new SynchronizationRequest(); SynchronizationRequest req2 = new SynchronizationRequest(); req.setUrl("http://localhost:8080/magnoliaPublic"); req.setWorkspace("website"); req.setFromPath("/travel"); req.setToPath("/travel"); req2.setUrl("http://localhost:8080/magnoliaPublic"); req2.setWorkspace("dam"); req2.setFromPath("/travel"); req2.setToPath("/travel"); SimpleSynchronizationManager synchronizationManager = (SimpleSynchronizationManager) Components.getComponent(SynchronizationManager.class); synchronizationManager.setPolicy(SynchronizationPolicy.AllowAll); synchronizationManager.synchronize(req); synchronizationManager.synchronize(req2); synchronizationManager.stopSynchronization(req.getIdentifier()); synchronizationManager.stopSynchronization(req2.getIdentifier()); synchronizationManager.getSynchronizationRequest(req2.getIdentifier()).get(); //req.getIdentifier().equals(req2.getIdentifier()) |
| Comments |
| Comment by Roman Kovařík [ 11/May/22 ] |
|
The code can return without the fix: SynchronizationRequest(executionStart=Wed May 11 12:24:30 CEST 2022, executionEnd=null, cancelled=null, state=RUNNING, created=Wed May 11 12:24:30 CEST 2022, identifier=synchronization-20220511-122430247, workspace=dam, path=null, recursive=true, fromDate=null, template=null, url=http://localhost:8080/magnoliaPublic, fromPath=/travel, toPath=/travel) which is the second request when the first one is requested.
With the fix, the correct request is returned: SynchronizationRequest(executionStart=null, executionEnd=null, cancelled=Wed May 11 12:27:22 CEST 2022, state=CANCELLED, created=Wed May 11 12:27:22 CEST 2022, identifier=synchronization-20220511-122722861, workspace=dam, path=null, recursive=true, fromDate=null, template=null, url=http://localhost:8080/magnoliaPublic, fromPath=/travel, toPath=/travel) |