Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-17113

Share doc preview not updated after new versions (eg. using AOS or manual upload new version or inline text editor ...)

    Details

      Description

      When documents are edited using the AOS the updates doesn't get reflected in the preview.

      To reproduce
      1. Edit a word document using "Edit in Microsoft Office". Start in the document details page.
      2. Save you changes in Word.
      3. Go to document details page. Refresh. Document is "Locked by you". Edits are not shown (expected since you still have the document open).
      4. Go back to word. Close the document.
      5. Go back to document details page. Refresh. Lock is gone. The preview still shows the older version. Expected: The preview will show the new version
      6. Click the download button. You can see that you edits are in the document, but not shown in the preview.

      Note: It sometimes shows the correct preview, so you may have to try a copule of times.
      Tested with AOS 1.1.3 and 5.2 Nightly from 2016-09-27 (cirka)

        Attachments

          Issue Links

            Activity

            Hide
            loftux Peter Löfgren added a comment -

            I've identified a few potential additional issues with the afterCommit

            • When a user has a file open in AOS it gets locked. If another user then browses this file or preview, the afterCommit fails since it is locked.
            • The transaction is running as the logged in user, not as system. This means that the afterCommit fails (silently) if a user with only read permission browses the file. Previews still gets generated/updated, but not the cm:lastThumbnailModification.
            • parts of the afterCommit is not wrapped in a new transaction. There are places where it can fail outside of the transaction, potentially causing the issues I'm seeing in this issue ALF-21811.
            • There are cases where the thumbnail nodeRef no longer exists (cause unknown) when entering the afterCommit. Resulting on node no longer exists errors

            I'm working on fixing this by

            Show
            loftux Peter Löfgren added a comment - I've identified a few potential additional issues with the afterCommit When a user has a file open in AOS it gets locked. If another user then browses this file or preview, the afterCommit fails since it is locked. The transaction is running as the logged in user, not as system. This means that the afterCommit fails (silently) if a user with only read permission browses the file. Previews still gets generated/updated, but not the cm:lastThumbnailModification. parts of the afterCommit is not wrapped in a new transaction. There are places where it can fail outside of the transaction, potentially causing the issues I'm seeing in this issue ALF-21811 . There are cases where the thumbnail nodeRef no longer exists (cause unknown) when entering the afterCommit. Resulting on node no longer exists errors I'm working on fixing this by Making sure the parentFile to the thumbnails is not locked when trying to update Run the afterCommit as System Moving the transaction wrapper to the afterCommit (and not just in addThumbnailModificationData) to make sure it all runs in a transaction Checking that node exists before doing anything. This line for example https://github.com/Alfresco/community-edition/blob/2c1eff9953d3105e738f7b06ba9ba8a079ca4c24/projects/repository/source/java/org/alfresco/repo/thumbnail/ThumbnailServiceImpl.java#L896 is a place where the node may no longer exist.
            Show
            loftux Peter Löfgren added a comment - Here is a link to my changes to fix the above https://github.com/loftuxab/alfresco-community-loftux/commit/bce9493e776bb67e1b1428040c60514803970117
            Hide
            loftux Peter Löfgren added a comment -

            I also added a small delay of 1.5 seconds before the window reload in Share Document details.
            This makes the likelihood of afterCommit to have completed and the new preview to get loaded. The delay is small enough for not to bother users.
            See https://github.com/loftuxab/share-community-loftux/commit/6532dee6ca44bc42162b7bbe11718050033e73e9

            Show
            loftux Peter Löfgren added a comment - I also added a small delay of 1.5 seconds before the window reload in Share Document details. This makes the likelihood of afterCommit to have completed and the new preview to get loaded. The delay is small enough for not to bother users. See https://github.com/loftuxab/share-community-loftux/commit/6532dee6ca44bc42162b7bbe11718050033e73e9
            Hide
            loftux Peter Löfgren added a comment -

            Did one additional change since I didn't get the lock check correct. It also prevented the lock owner from updating.
            Wit this change the user holding the lock can update in the afterCommit (ie the user editing in office and saving)
            https://github.com/loftuxab/alfresco-community-loftux/commit/1a4cad86c682b5315c7cc86eb218b9e2c35aa672

            Show
            loftux Peter Löfgren added a comment - Did one additional change since I didn't get the lock check correct. It also prevented the lock owner from updating. Wit this change the user holding the lock can update in the afterCommit (ie the user editing in office and saving) https://github.com/loftuxab/alfresco-community-loftux/commit/1a4cad86c682b5315c7cc86eb218b9e2c35aa672
            Hide
            loftux Peter Löfgren added a comment -

            Hi,

            I had in my fix for this changes to check if a node exists, your fix based on what I did excluded that part.
            With 201702GA I just got

            2017-02-22 13:40:52,986  ERROR [util.transaction.TransactionSupportUtil] [defaultAsyncAction6] After completion (committed) TransactionalCache exception
             org.alfresco.service.cmr.repository.InvalidNodeRefException: Node does not exist: workspace://SpacesStore/9521ddcc-abd5-4fdc-86a3-2134a9ca3a8d (status:Status[id=825changeTxnId=f8119502-af7d-43c4-864e-9bd70db08737, dbTxnId=69, deleted=true])
            	at org.alfresco.repo.node.db.DbNodeServiceImpl.getNodePairNotNull(DbNodeServiceImpl.java:198)
            	at org.alfresco.repo.node.db.DbNodeServiceImpl.hasAspect_aroundBody38(DbNodeServiceImpl.java:1043)
            	at org.alfresco.repo.node.db.DbNodeServiceImpl$AjcClosure39.run(DbNodeServiceImpl.java:1)
            	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
            	at org.alfresco.traitextender.RouteExtensions.intercept(RouteExtensions.java:100)
            	at org.alfresco.repo.node.db.DbNodeServiceImpl.hasAspect(DbNodeServiceImpl.java:1037)
            	at sun.reflect.GeneratedMethodAccessor197.invoke(Unknown Source)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            	at java.lang.reflect.Method.invoke(Method.java:498)
            	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
            	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
            	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
            	at org.alfresco.repo.lock.mem.LockableAspectInterceptor.invoke(LockableAspectInterceptor.java:126)
            	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
            	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
            	at com.sun.proxy.$Proxy26.hasAspect(Unknown Source)
            	at sun.reflect.GeneratedMethodAccessor197.invoke(Unknown Source)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            	at java.lang.reflect.Method.invoke(Method.java:498)
            	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
            	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
            	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
            	at org.alfresco.repo.tenant.MultiTNodeServiceInterceptor.invoke(MultiTNodeServiceInterceptor.java:111)
            	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
            	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
            	at com.sun.proxy.$Proxy26.hasAspect(Unknown Source)
            	at sun.reflect.GeneratedMethodAccessor197.invoke(Unknown Source)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            	at java.lang.reflect.Method.invoke(Method.java:498)
            	at org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:231)
            	at com.sun.proxy.$Proxy48.hasAspect(Unknown Source)
            	at org.alfresco.repo.node.MLPropertyInterceptor.getPivotNodeRef(MLPropertyInterceptor.java:329)
            	at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:168)
            	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
            	at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:205)
            	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
            	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
            	at com.sun.proxy.$Proxy26.getProperty(Unknown Source)
            	at sun.reflect.GeneratedMethodAccessor231.invoke(Unknown Source)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            	at java.lang.reflect.Method.invoke(Method.java:498)
            	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
            	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
            	at com.sun.proxy.$Proxy26.getProperty(Unknown Source)
            	at org.alfresco.repo.thumbnail.ThumbnailServiceImpl$ThumbnailTransactionListenerAdapter$1$1.execute(ThumbnailServiceImpl.java:913)
            	at org.alfresco.repo.thumbnail.ThumbnailServiceImpl$ThumbnailTransactionListenerAdapter$1$1.execute(ThumbnailServiceImpl.java:1)
            	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:464)
            	at org.alfresco.repo.thumbnail.ThumbnailServiceImpl$ThumbnailTransactionListenerAdapter$1.doWork(ThumbnailServiceImpl.java:903)
            	at org.alfresco.repo.thumbnail.ThumbnailServiceImpl$ThumbnailTransactionListenerAdapter$1.doWork(ThumbnailServiceImpl.java:1)
            	at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:555)
            	at org.alfresco.repo.thumbnail.ThumbnailServiceImpl$ThumbnailTransactionListenerAdapter.afterCommit(ThumbnailServiceImpl.java:894)
            	at org.alfresco.util.transaction.TransactionSupportUtil$TransactionSynchronizationImpl.afterCompletion(TransactionSupportUtil.java:597)
            	at org.springframework.transaction.support.TransactionSynchronizationUtils.invokeAfterCompletion(TransactionSynchronizationUtils.java:168)
            	at org.springframework.transaction.support.AbstractPlatformTransactionManager.invokeAfterCompletion(AbstractPlatformTransactionManager.java:994)
            	at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerAfterCompletion(AbstractPlatformTransactionManager.java:969)
            	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:800)
            	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724)
            	at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:475)
            	at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransaction.java:482)
            	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:486)
            	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:333)
            	at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper$1.doWork(AsynchronousActionExecutionQueueImpl.java:439)
            	at org.alfresco.repo.tenant.TenantUtil.runAsWork(TenantUtil.java:126)
            	at org.alfresco.repo.tenant.TenantUtil.runAsTenant(TenantUtil.java:95)
            	at org.alfresco.repo.tenant.TenantUtil$1.doWork(TenantUtil.java:69)
            	at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:555)
            	at org.alfresco.repo.tenant.TenantUtil.runAsUserTenant(TenantUtil.java:65)
            	at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper.run(AsynchronousActionExecutionQueueImpl.java:442)
            	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            	at java.lang.Thread.run(Thread.java:745)
            

            This may not propagate to cause ACE-5478 hibernate exceptions since it is now wrapped in a transaction, but can easily be handled with proper checks in the code if the node still exists.

            Show
            loftux Peter Löfgren added a comment - Hi, I had in my fix for this changes to check if a node exists, your fix based on what I did excluded that part. With 201702GA I just got 2017-02-22 13:40:52,986 ERROR [util.transaction.TransactionSupportUtil] [defaultAsyncAction6] After completion (committed) TransactionalCache exception org.alfresco.service.cmr.repository.InvalidNodeRefException: Node does not exist: workspace: //SpacesStore/9521ddcc-abd5-4fdc-86a3-2134a9ca3a8d (status:Status[id=825changeTxnId=f8119502-af7d-43c4-864e-9bd70db08737, dbTxnId=69, deleted= true ]) at org.alfresco.repo.node.db.DbNodeServiceImpl.getNodePairNotNull(DbNodeServiceImpl.java:198) at org.alfresco.repo.node.db.DbNodeServiceImpl.hasAspect_aroundBody38(DbNodeServiceImpl.java:1043) at org.alfresco.repo.node.db.DbNodeServiceImpl$AjcClosure39.run(DbNodeServiceImpl.java:1) at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149) at org.alfresco.traitextender.RouteExtensions.intercept(RouteExtensions.java:100) at org.alfresco.repo.node.db.DbNodeServiceImpl.hasAspect(DbNodeServiceImpl.java:1037) at sun.reflect.GeneratedMethodAccessor197.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.alfresco.repo.lock.mem.LockableAspectInterceptor.invoke(LockableAspectInterceptor.java:126) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy26.hasAspect(Unknown Source) at sun.reflect.GeneratedMethodAccessor197.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.alfresco.repo.tenant.MultiTNodeServiceInterceptor.invoke(MultiTNodeServiceInterceptor.java:111) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy26.hasAspect(Unknown Source) at sun.reflect.GeneratedMethodAccessor197.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:231) at com.sun.proxy.$Proxy48.hasAspect(Unknown Source) at org.alfresco.repo.node.MLPropertyInterceptor.getPivotNodeRef(MLPropertyInterceptor.java:329) at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:168) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:205) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy26.getProperty(Unknown Source) at sun.reflect.GeneratedMethodAccessor231.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198) at com.sun.proxy.$Proxy26.getProperty(Unknown Source) at org.alfresco.repo.thumbnail.ThumbnailServiceImpl$ThumbnailTransactionListenerAdapter$1$1.execute(ThumbnailServiceImpl.java:913) at org.alfresco.repo.thumbnail.ThumbnailServiceImpl$ThumbnailTransactionListenerAdapter$1$1.execute(ThumbnailServiceImpl.java:1) at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:464) at org.alfresco.repo.thumbnail.ThumbnailServiceImpl$ThumbnailTransactionListenerAdapter$1.doWork(ThumbnailServiceImpl.java:903) at org.alfresco.repo.thumbnail.ThumbnailServiceImpl$ThumbnailTransactionListenerAdapter$1.doWork(ThumbnailServiceImpl.java:1) at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:555) at org.alfresco.repo.thumbnail.ThumbnailServiceImpl$ThumbnailTransactionListenerAdapter.afterCommit(ThumbnailServiceImpl.java:894) at org.alfresco.util.transaction.TransactionSupportUtil$TransactionSynchronizationImpl.afterCompletion(TransactionSupportUtil.java:597) at org.springframework.transaction.support.TransactionSynchronizationUtils.invokeAfterCompletion(TransactionSynchronizationUtils.java:168) at org.springframework.transaction.support.AbstractPlatformTransactionManager.invokeAfterCompletion(AbstractPlatformTransactionManager.java:994) at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerAfterCompletion(AbstractPlatformTransactionManager.java:969) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:800) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:475) at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransaction.java:482) at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:486) at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:333) at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper$1.doWork(AsynchronousActionExecutionQueueImpl.java:439) at org.alfresco.repo.tenant.TenantUtil.runAsWork(TenantUtil.java:126) at org.alfresco.repo.tenant.TenantUtil.runAsTenant(TenantUtil.java:95) at org.alfresco.repo.tenant.TenantUtil$1.doWork(TenantUtil.java:69) at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:555) at org.alfresco.repo.tenant.TenantUtil.runAsUserTenant(TenantUtil.java:65) at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper.run(AsynchronousActionExecutionQueueImpl.java:442) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang. Thread .run( Thread .java:745) This may not propagate to cause ACE-5478 hibernate exceptions since it is now wrapped in a transaction, but can easily be handled with proper checks in the code if the node still exists.

              People

              • Assignee:
                closedbugs Closed Bugs
                Reporter:
                loftux Peter Löfgren
              • Votes:
                4 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 week, 3 days, 1 hour
                  1w 3d 1h