REPO-4099 Change of mimetype to unsupported rendition hangs Share (#298) (#304)

* REPO-4099 Change of mimetype to unsupported rendition hangs Share (#298)

Only include URL and mimetype when working out the content hashCode as we don't want it to change if deleted.
This commit is contained in:
alandavis
2018-12-18 06:08:25 +00:00
committed by GitHub
parent 103570ff3a
commit a641831900
2 changed files with 3 additions and 5 deletions

View File

@@ -494,7 +494,7 @@ public class RenditionService2Impl implements RenditionService2, InitializingBea
if (contentData != null) if (contentData != null)
{ {
// Originally we used the contentData URL, but that is not enough if the mimetype changes. // Originally we used the contentData URL, but that is not enough if the mimetype changes.
String contentString = contentData.toString(); String contentString = contentData.getContentUrl()+contentData.getMimetype();
if (contentString != null) if (contentString != null)
{ {
hashCode = contentString.hashCode(); hashCode = contentString.hashCode();

View File

@@ -137,10 +137,8 @@ public class LegacyLocalTransformClientIntegrationTest extends AbstractRendition
// split into separate transactions as the client is async // split into separate transactions as the client is async
NodeRef sourceNode = transactionService.getRetryingTransactionHelper().doInTransaction(() -> NodeRef sourceNode = transactionService.getRetryingTransactionHelper().doInTransaction(() ->
createContentNodeFromQuickFile(testFileName)); createContentNodeFromQuickFile(testFileName));
int sourceContentHashCode = DefaultTypeConverter.INSTANCE.convert( ContentData contentData = DefaultTypeConverter.INSTANCE.convert(ContentData.class, nodeService.getProperty(sourceNode, PROP_CONTENT));
ContentData.class, int sourceContentHashCode = (contentData == null ? "" : contentData.getContentUrl()+contentData.getMimetype()).hashCode();
nodeService.getProperty(sourceNode, PROP_CONTENT))
.toString().hashCode();
transactionService.getRetryingTransactionHelper().doInTransaction(() -> transactionService.getRetryingTransactionHelper().doInTransaction(() ->
{ {
RenditionDefinition2 renditionDefinition = RenditionDefinition2 renditionDefinition =