{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/comments/70026445","id":70026445,"diff_hunk":"@@ -152,9 +152,14 @@ - (NSUInteger)_findTruncationInsertionPointAtOrBeforeCharacterIndex:(NSUInteger)\n \n - (void)truncate\n {\n+  // Reset the text storage to start always with the full string\n+  [_context resetTextStorage];","path":"AsyncDisplayKit/TextKit/ASTextKitTailTruncater.mm","position":5,"original_position":5,"commit_id":"9d1e6691085f994dcbc4789e87881ee2f4ce0ad5","original_commit_id":"9d1e6691085f994dcbc4789e87881ee2f4ce0ad5","user":{"login":"appleguy","id":565251,"avatar_url":"https://avatars.githubusercontent.com/u/565251?v=3","gravatar_id":"","url":"https://api.github.com/users/appleguy","html_url":"https://github.com/appleguy","followers_url":"https://api.github.com/users/appleguy/followers","following_url":"https://api.github.com/users/appleguy/following{/other_user}","gists_url":"https://api.github.com/users/appleguy/gists{/gist_id}","starred_url":"https://api.github.com/users/appleguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appleguy/subscriptions","organizations_url":"https://api.github.com/users/appleguy/orgs","repos_url":"https://api.github.com/users/appleguy/repos","events_url":"https://api.github.com/users/appleguy/events{/privacy}","received_events_url":"https://api.github.com/users/appleguy/received_events","type":"User","site_admin":false},"body":"It seems to me that because the code below is responsible for modifying the string, this object should probably also be responsible for ensuring that it is working from the original string before truncating.  Can we have this object obtain the string it truncates from a delegate or something, probably the ASTextNode itself, so the data flow is always in the same direction / at the same level?\r\n\r\nMaybe this is a bad idea.  This is largely an existing architectural problem, not just a problem with the solution - we're essentially talking about how to adjust the solution to be as clear as possible considering the architecture is a bit strange here.  Open to any suggestions, happy to land this without changes / just adding comments if you are confident it is the best structure.","created_at":"2016-07-08T05:22:33Z","updated_at":"2016-07-08T05:22:33Z","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/1863#discussion_r70026445","pull_request_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/1863","_links":{"self":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/comments/70026445"},"html":{"href":"https://github.com/facebook/AsyncDisplayKit/pull/1863#discussion_r70026445"},"pull_request":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/1863"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/1863","id":76681444,"html_url":"https://github.com/facebook/AsyncDisplayKit/pull/1863","diff_url":"https://github.com/facebook/AsyncDisplayKit/pull/1863.diff","patch_url":"https://github.com/facebook/AsyncDisplayKit/pull/1863.patch","issue_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/1863","number":1863,"state":"open","locked":false,"title":"[ASTextNode] Fix text node truncation","user":{"login":"maicki","id":25288,"avatar_url":"https://avatars.githubusercontent.com/u/25288?v=3","gravatar_id":"","url":"https://api.github.com/users/maicki","html_url":"https://github.com/maicki","followers_url":"https://api.github.com/users/maicki/followers","following_url":"https://api.github.com/users/maicki/following{/other_user}","gists_url":"https://api.github.com/users/maicki/gists{/gist_id}","starred_url":"https://api.github.com/users/maicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maicki/subscriptions","organizations_url":"https://api.github.com/users/maicki/orgs","repos_url":"https://api.github.com/users/maicki/repos","events_url":"https://api.github.com/users/maicki/events{/privacy}","received_events_url":"https://api.github.com/users/maicki/received_events","type":"User","site_admin":false},"body":"Before truncation happens no invalidation of the text storage happened. That had the effect, if the constrained size of a text node increases a new size for the text node will be calculated. While this calculation is happening a truncation on the text will happen. Unfortunately the truncation will happen on the already truncated string.\r\n\r\nThis PR resets the text storage to the original value before the truncation is happening so it always will truncate on the same string no matter what constrained size is given.\r\n\r\nShould fix #1841","created_at":"2016-07-07T23:25:36Z","updated_at":"2016-07-08T05:22:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f436ca958ef7c6d60e6a884ee89f0dbd97d516bc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/1863/commits","review_comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/1863/comments","review_comment_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/1863/comments","statuses_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/statuses/9d1e6691085f994dcbc4789e87881ee2f4ce0ad5","head":{"label":"maicki:MSFixTextNodeTruncation","ref":"MSFixTextNodeTruncation","sha":"9d1e6691085f994dcbc4789e87881ee2f4ce0ad5","user":{"login":"maicki","id":25288,"avatar_url":"https://avatars.githubusercontent.com/u/25288?v=3","gravatar_id":"","url":"https://api.github.com/users/maicki","html_url":"https://github.com/maicki","followers_url":"https://api.github.com/users/maicki/followers","following_url":"https://api.github.com/users/maicki/following{/other_user}","gists_url":"https://api.github.com/users/maicki/gists{/gist_id}","starred_url":"https://api.github.com/users/maicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maicki/subscriptions","organizations_url":"https://api.github.com/users/maicki/orgs","repos_url":"https://api.github.com/users/maicki/repos","events_url":"https://api.github.com/users/maicki/events{/privacy}","received_events_url":"https://api.github.com/users/maicki/received_events","type":"User","site_admin":false},"repo":{"id":50892794,"name":"AsyncDisplayKit","full_name":"maicki/AsyncDisplayKit","owner":{"login":"maicki","id":25288,"avatar_url":"https://avatars.githubusercontent.com/u/25288?v=3","gravatar_id":"","url":"https://api.github.com/users/maicki","html_url":"https://github.com/maicki","followers_url":"https://api.github.com/users/maicki/followers","following_url":"https://api.github.com/users/maicki/following{/other_user}","gists_url":"https://api.github.com/users/maicki/gists{/gist_id}","starred_url":"https://api.github.com/users/maicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maicki/subscriptions","organizations_url":"https://api.github.com/users/maicki/orgs","repos_url":"https://api.github.com/users/maicki/repos","events_url":"https://api.github.com/users/maicki/events{/privacy}","received_events_url":"https://api.github.com/users/maicki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maicki/AsyncDisplayKit","description":"Smooth asynchronous user interfaces for iOS apps.","fork":true,"url":"https://api.github.com/repos/maicki/AsyncDisplayKit","forks_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/forks","keys_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/teams","hooks_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/hooks","issue_events_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/issues/events{/number}","events_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/events","assignees_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/assignees{/user}","branches_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/branches{/branch}","tags_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/tags","blobs_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/statuses/{sha}","languages_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/languages","stargazers_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/stargazers","contributors_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/contributors","subscribers_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/subscribers","subscription_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/subscription","commits_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/contents/{+path}","compare_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/merges","archive_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/downloads","issues_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/issues{/number}","pulls_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/pulls{/number}","milestones_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/milestones{/number}","notifications_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/labels{/name}","releases_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/releases{/id}","deployments_url":"https://api.github.com/repos/maicki/AsyncDisplayKit/deployments","created_at":"2016-02-02T03:59:55Z","updated_at":"2016-04-23T02:52:21Z","pushed_at":"2016-07-08T00:10:31Z","git_url":"git://github.com/maicki/AsyncDisplayKit.git","ssh_url":"git@github.com:maicki/AsyncDisplayKit.git","clone_url":"https://github.com/maicki/AsyncDisplayKit.git","svn_url":"https://github.com/maicki/AsyncDisplayKit","homepage":"http://asyncdisplaykit.org","size":46579,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"332ab2330add166e9c16a37be54efe4d2cf79b1e","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":21265042,"name":"AsyncDisplayKit","full_name":"facebook/AsyncDisplayKit","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/AsyncDisplayKit","description":"Smooth asynchronous user interfaces for iOS apps.","fork":false,"url":"https://api.github.com/repos/facebook/AsyncDisplayKit","forks_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/forks","keys_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/teams","hooks_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/hooks","issue_events_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/events","assignees_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/tags","blobs_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/languages","stargazers_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/stargazers","contributors_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/contributors","subscribers_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/subscribers","subscription_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/subscription","commits_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/merges","archive_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/downloads","issues_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/labels{/name}","releases_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/deployments","created_at":"2014-06-27T05:29:02Z","updated_at":"2016-07-08T03:26:13Z","pushed_at":"2016-07-08T05:10:00Z","git_url":"git://github.com/facebook/AsyncDisplayKit.git","ssh_url":"git@github.com:facebook/AsyncDisplayKit.git","clone_url":"https://github.com/facebook/AsyncDisplayKit.git","svn_url":"https://github.com/facebook/AsyncDisplayKit","homepage":"http://asyncdisplaykit.org","size":70792,"stargazers_count":8612,"watchers_count":8612,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1450,"mirror_url":null,"open_issues_count":123,"forks":1450,"open_issues":123,"watchers":8612,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/1863"},"html":{"href":"https://github.com/facebook/AsyncDisplayKit/pull/1863"},"issue":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/1863"},"comments":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/1863/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/1863/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/1863/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/statuses/9d1e6691085f994dcbc4789e87881ee2f4ce0ad5"}}}}
{"actor":{"display_login":"appleguy"}}