{ "id": "124018", "key": "TIMOB-16200", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2013-12-19T11:41:01.000+0000", "priority": null, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:04:15.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [], "description": "CCPhoto.m Line:227\r\n\r\n\r\n-(NSString *)localPathForPhotoSize:(NSString *)photoSize\r\n{\r\nreturn [NSString stringWithFormat:@\"%@/%@_%d\", [Cocoafish defaultCocoafish].cocoafishDir, self.objectId, photoSize];\r\n}\r\n\r\n\r\nACS photos can not update if the photo id is the same.\r\n \r\nWhen we were developing Facebook like SNS, we used photos on ACS for the user's profile. And we tried to change the photo, but it didn't. So looked into the source and found the problem. \r\n\r\nLine: 215\r\n-(UIImage *)getImageForPhotoSize:(NSString *)photoSize;\r\n\r\nThis method cache photo data. And it will be used objectID for the cache data path.\r\n\r\n\r\nWhen user in ACS updated the photo, photo's objectID will not be changed and only photo itself will be replaced. The cache and loading cache by getImageForPhotoSize: method can not be used because this tries to use the existing cache unless the objectID wouldn't change.\r\n\r\nSo we fixed as following;\r\n\r\n\r\n-(NSString *)localPathForPhotoSize:(NSString *)photoSize\r\n{\r\n return [NSString stringWithFormat:@\"%@/%@_%@\", [Cocoafish defaultCocoafish].cocoafishDir, self.md5, photoSize];\r\n}\r\n\r\nWe used md5 instead of objectID. \r\n\r\nAnd as follwoing, there is also the problem. \r\nLine:207\r\n-(NSString *)localPath:(PhotoSize)photoSize\r\n{\r\n if (photoSize < CC_SQUARE_75 || photoSize > CC_ORIGINAL) {\r\n [NSException raise:@\"Invalid Photo Size\" format:@\"Unknown photo size\",photoSize];\r\n }\r\nreturn [NSString stringWithFormat:@\"%@/%@_%d\", [Cocoafish defaultCocoafish].cocoafishDir, self.objectId, photoSize];\r\n}\r\n\r\n\r\nSo we changed to use md5 instead of objectID.\r\n\r\n-(NSString *)localPath:(PhotoSize)photoSize\r\n{\r\n if (photoSize < CC_SQUARE_75 || photoSize > CC_ORIGINAL) {\r\n [NSException raise:@\"Invalid Photo Size\" format:@\"Unknown photo size\",photoSize];\r\n }\r\nreturn [self localPathForPhotoSize:[CCPhoto getPhotoSizeString:photoSize]];\r\n}\r\n", "attachment": [], "flagged": false, "summary": "ACS: Cache problem in ACS", "creator": { "name": "kaz_konno", "key": "kaz_konno", "displayName": "kazuaki konno", "active": true, "timeZone": "Asia/Tokyo" }, "subtasks": [], "reporter": { "name": "kaz_konno", "key": "kaz_konno", "displayName": "kazuaki konno", "active": true, "timeZone": "Asia/Tokyo" }, "environment": null, "comment": { "comments": [ { "id": "285350", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks for reporting this problem. Engineering is going to review this issue and provide an update shortly.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-20T07:11:55.000+0000", "updated": "2013-12-20T07:11:55.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }