{"action":"created","issue":{"url":"https://api.github.com/repos/sillsdev/web-languageforge/issues/231","repository_url":"https://api.github.com/repos/sillsdev/web-languageforge","labels_url":"https://api.github.com/repos/sillsdev/web-languageforge/issues/231/labels{/name}","comments_url":"https://api.github.com/repos/sillsdev/web-languageforge/issues/231/comments","events_url":"https://api.github.com/repos/sillsdev/web-languageforge/issues/231/events","html_url":"https://github.com/sillsdev/web-languageforge/pull/231","id":317720751,"number":231,"title":"Replace custom IndexedDB wrapper with localForage","user":{"login":"Nateowami","id":6140710,"avatar_url":"https://avatars1.githubusercontent.com/u/6140710?v=4","gravatar_id":"","url":"https://api.github.com/users/Nateowami","html_url":"https://github.com/Nateowami","followers_url":"https://api.github.com/users/Nateowami/followers","following_url":"https://api.github.com/users/Nateowami/following{/other_user}","gists_url":"https://api.github.com/users/Nateowami/gists{/gist_id}","starred_url":"https://api.github.com/users/Nateowami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nateowami/subscriptions","organizations_url":"https://api.github.com/users/Nateowami/orgs","repos_url":"https://api.github.com/users/Nateowami/repos","events_url":"https://api.github.com/users/Nateowami/events{/privacy}","received_events_url":"https://api.github.com/users/Nateowami/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":27,"created_at":"2018-04-25T17:21:34Z","updated_at":"2018-05-15T18:56:12Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/sillsdev/web-languageforge/pulls/231","html_url":"https://github.com/sillsdev/web-languageforge/pull/231","diff_url":"https://github.com/sillsdev/web-languageforge/pull/231.diff","patch_url":"https://github.com/sillsdev/web-languageforge/pull/231.patch"},"body":"A few notes:\r\n\r\n- There is still offline-cache.service.ts. For the most part it is a light wrapper around localForage. It takes care of adding projectId before storing an object and removing the property from the object when fetching it from the data store. It also adds the ability to perform bulk operations and takes care of creating localForage stores when they are needed.\r\n- E2e tests are passing, but they do not extensively test offline functionality (they do load data from the cache though, and they did fail when some storage logic was incorrect).\r\n- To test the changes locally, don't forget to run `gulp webpack-lf`.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/sillsdev/web-languageforge/231)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/sillsdev/web-languageforge/issues/comments/389275841","html_url":"https://github.com/sillsdev/web-languageforge/pull/231#issuecomment-389275841","issue_url":"https://api.github.com/repos/sillsdev/web-languageforge/issues/231","id":389275841,"user":{"login":"Nateowami","id":6140710,"avatar_url":"https://avatars1.githubusercontent.com/u/6140710?v=4","gravatar_id":"","url":"https://api.github.com/users/Nateowami","html_url":"https://github.com/Nateowami","followers_url":"https://api.github.com/users/Nateowami/followers","following_url":"https://api.github.com/users/Nateowami/following{/other_user}","gists_url":"https://api.github.com/users/Nateowami/gists{/gist_id}","starred_url":"https://api.github.com/users/Nateowami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nateowami/subscriptions","organizations_url":"https://api.github.com/users/Nateowami/orgs","repos_url":"https://api.github.com/users/Nateowami/repos","events_url":"https://api.github.com/users/Nateowami/events{/privacy}","received_events_url":"https://api.github.com/users/Nateowami/received_events","type":"User","site_admin":false},"created_at":"2018-05-15T18:56:12Z","updated_at":"2018-05-15T18:56:12Z","author_association":"COLLABORATOR","body":"\n\n\n\nReview status: 5 of 7 files reviewed at latest revision, 3 unresolved discussions.\n\n---\n\n*[src/angular-app/bellows/core/offline/offline-cache.service.ts, line 10 at r3](https://reviewable.io/reviews/sillsdev/web-languageforge/231#-LBwfSf271P-kG4y53iD:-LCZyX0H7ITsAsm6MRuQ:b-896fix) ([raw file](https://github.com/sillsdev/web-languageforge/blob/a37ee3627ba3b06de2a5bd56f7f13ca40a69f3e6/src/angular-app/bellows/core/offline/offline-cache.service.ts#L10)):*\n<details><summary><i>Previously, irahopkinson (Ira Hopkinson) wrote…</i></summary><blockquote>\n\n> ```\n>  $inject\n> ```\nStyle: `$inject` declaration and the **constructor** are strongly linked. Place them together with **no** line between. I.e. move the `stores` declaration to either above or below the `version` declaration.\n</blockquote></details>\n\nDone.\n\n---\n\n*[src/angular-app/bellows/core/offline/offline-cache.service.ts, line 16 at r3](https://reviewable.io/reviews/sillsdev/web-languageforge/231#-LBwlrRo1GEivJH6i0U4:-LCZyabaAsvAgaZY1hvG:b-7ga6na) ([raw file](https://github.com/sillsdev/web-languageforge/blob/a37ee3627ba3b06de2a5bd56f7f13ca40a69f3e6/src/angular-app/bellows/core/offline/offline-cache.service.ts#L16)):*\n<details><summary><i>Previously, irahopkinson (Ira Hopkinson) wrote…</i></summary><blockquote>\n\nDo all the E2E tests pass? I thought you mentioned that had stopped working somewhere but can't find any reference to that now. If I was to guess I would say is the `canCache` needs to be changed back to an arrow function. When you pass a function as a reference it needs to be an arrow function so that the local scope is available to it from the remote call to the referenced function. So change `static canCache(): boolean {` to `static canCache = (): boolean => {`\n</blockquote></details>\n\nI had been having trouble with flaky e2e tests, but I didn't think the failures were related to my changes. \n\nWith regards to arrow functions: What they change is the meaning of `this` within a function. Either way the external scope is available to the function. I'm happy to change it back if you still think it's necessary.\n\n---\n\n*[src/angular-app/bellows/core/offline/offline-cache.service.ts, line 29 at r3](https://reviewable.io/reviews/sillsdev/web-languageforge/231#-LBwib-34id2ihwnb7NA:-LC_7_oHAB0i4srn9ILH:b-896fix) ([raw file](https://github.com/sillsdev/web-languageforge/blob/a37ee3627ba3b06de2a5bd56f7f13ca40a69f3e6/src/angular-app/bellows/core/offline/offline-cache.service.ts#L29)):*\n<details><summary><i>Previously, irahopkinson (Ira Hopkinson) wrote…</i></summary><blockquote>\n\nIf `projectId == null` i.e. is not defined then this should still push results so that it returns all projects.\n</blockquote></details>\n\nDone.\n\n---\n\n\n*Comments from [Reviewable](https://reviewable.io/reviews/sillsdev/web-languageforge/231)*\n<!-- Sent from Reviewable.io -->\n"}}
{"actor":{"display_login":"Nateowami"}}