{"push_id":3170747911,"size":28,"distinct_size":0,"ref":"refs/heads/master","head":"060c173689e0f31c4297ffe975d38a6697419f55","before":"8a4efa98822c6955b0faf79096df6af4c5705b1b","commits":[{"sha":"034e25be889e1ac044c8279dd6a2f1215dbefdbb","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"notif: Move refresh/initialize logic out of realmActions.\n\nLike some recent previous refactors here, concentrating this logic in\nthe `notifications.js` file makes it more straightforward to read and\nreason about, and will also make further refactors easier.","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/034e25be889e1ac044c8279dd6a2f1215dbefdbb"},{"sha":"248761eb13e253ce0739fbcf0124e6d845871141","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"notif: Separate get-token code by platform.\n\nThe iOS and Android paths don't have a lot in common here, so it's\nclearer just to set them each out as a coherent whole, separate from\nthe other.","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/248761eb13e253ce0739fbcf0124e6d845871141"},{"sha":"c2ed78e7e6c9b46ed4c1cf0d0b66ae87b2b0ce40","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"notif: Drop `result` and `msg` from pushToken state.\n\nWe never actually use these; and outside of bugs, there's no\ninteresting information the server returns anyway for them to store.\nFor investigating bugs, we have a wide variety of other tools.","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/c2ed78e7e6c9b46ed4c1cf0d0b66ae87b2b0ce40"},{"sha":"26048f8b9c94fa65e02a85362862c87d56841b53","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"notif: Drop `result` and `msg` from SAVE_TOKEN_PUSH actions.\n\nWe just stopped storing these, in the parent commit; stop passing them\naround, either.","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/26048f8b9c94fa65e02a85362862c87d56841b53"},{"sha":"344ae0390c0fc36be675776f19db760fbfa8ebc2","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"notif: Factor out \"unregister\" logic from two components.\n\nThis is better handled with our other notifications code than in\ncomponent code... and much better than in *two* components' code,\ndoing the exact same thing.\n\nWe'll move most of this logic to the actual `notifications.js` in the\nnext commit, like we did for the `initNotifications` action in a\nrecent previous commit; committing this separately to make super clear\nthe aspect of this change that is just moving this code verbatim.\n\nThe actual logic this is carrying out is pretty dubious, but we'll be\nin a better position to change and fix it after moving it where it\nbelongs.","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/344ae0390c0fc36be675776f19db760fbfa8ebc2"},{"sha":"014765f4e69ae9a1890094c782079f1201410a3d","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"notif: Move tryStopNotifications logic into notifications code.\n\nLike with `getNotificationToken` in previous commits, this puts us in\na better position to improve this logic.","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/014765f4e69ae9a1890094c782079f1201410a3d"},{"sha":"3a2076e0f7a99da52d815056b63638a2d576d276","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"notif: Represent a missing token with `null`, not `''`.\n\nThe empty string is not a good sentinel.  This is more idiomatic\nand clearer.\n\nOne conditional had checked for `oldToken === undefined`; on studying\nthis code to make this change, this doesn't actually appear to be\npossible, so drop that.","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/3a2076e0f7a99da52d815056b63638a2d576d276"},{"sha":"3706965d3169e31312201437e649e544a6a168d9","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"account: Cut Reselect for trivial selectors.\n\nNone of these do any appreciable work that would benefit from caching.\nSimplify thinking about the code by cutting the use of Reselect.","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/3706965d3169e31312201437e649e544a6a168d9"},{"sha":"33a4df2183c3fa4ed5b098438b8c3a74b909c3fc","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"account: Split `getActiveAccount`, with a version that asserts.\n\nIn the bulk of the places where we use this (mostly via `getAuth` and\na few other thin wrappers around it), we're rendering UI that is all\nabout messages, users, etc. that the user has access to via a\nparticular account -- so the code pervasively assumes, and should\nassume, that there is in fact an active account.\n\nSo, provide a way to make that explicit.  No empty-string fallback\nwhich might not crash but would look badly broken; no `undefined`\nfallback which would propagate through the types and force a bunch of\nnever-exercised fallback code elsewhere, much of which again would\nproduce badly broken results if it ever did somehow fire; just\nacknowledge the assumption up front, and then have an honest, valid\nAccount object.\n\nThis function itself has only a handful of call sites.  The one site\noutside this file is one that wants the \"assert\" version, like most of\nour code.  The others have a number of call sites of their own, so we\nkeep their semantics unchanged for now, and we'll handle them in\nseparate commits.","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/33a4df2183c3fa4ed5b098438b8c3a74b909c3fc"},{"sha":"124fa7b0e190bd592c91c20eda82029e3f62e980","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"account: Replace empty-string fallback in getOwnEmail with assert.\n\nEvery call site of this function is, like most of our code, a place\nwhere we assume there's an active account and so this is the behavior\nwe want.","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/124fa7b0e190bd592c91c20eda82029e3f62e980"},{"sha":"258b8c94eb50c209fd4c2bc997d83668904547d4","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"account: Replace empty-string fallback with assert, in getCurrentRealm.\n\nMuch like the parent commit.  Each call site already depends on the\nassumption that `realm` is a real realm URL and not the empty string.\n\nAt one call site, `WebLink`, it isn't directly obvious we have that\nassumption, and in principle with certain ways of using it we\nwouldn't; but we must assume it whenever `href` is relative, which\nin fact it is in the one place we use `WebLink`.  (The semantics in\nturn of `getFullUrl` are pretty broken, but fixing that will be for\nanother day.)","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/258b8c94eb50c209fd4c2bc997d83668904547d4"},{"sha":"3c69446471fa978cfd7a65f9450fd0b3509901c6","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"AccountList: Simplify redundant logic; no need for `auth`.\n\nIf the `accounts` array is nonempty, then `auth` is just its first\nelement; so there's no need to pass both.\n\nSpecifically, if we reach this `index === 0` condition and it's true,\nthen in fact `auth === item`.  Use that to simplify the rest and\neliminate `auth`.","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/3c69446471fa978cfd7a65f9450fd0b3509901c6"},{"sha":"894cfa846a3ed6345fd7a9a719ffaf64ed423f8d","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"account: Organize selector tests a bit.\n\nVery small changes other than indentation.","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/894cfa846a3ed6345fd7a9a719ffaf64ed423f8d"},{"sha":"c12167416dbcd373c7e9c5816e274fe1c15b3633","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"account: Add `tryGetValidAuth`, and use where appropriate.\n\nThese are remaining spots where we use `getAuth`, and don't assume\nthat there is some account/auth object there for it to return.\n\nIn both call sites, we're only interested in an auth object that\nactually has an API key; so specify this selector accordingly.\n\nFor checking that an `Account` object really has an API key, we rely\non what the type tells us: the `apiKey` property is there, and it's a\nstring.  That's been true since forever for Account objects of\nlogged-in accounts, naturally, and since sometime in 2016 for\nlogged-out accounts; and since e0a32f93f last March for newly-added,\nnever-logged-in accounts.  That's well past the horizon of\ninvalid-data scenarios we're prepared to handle in general.","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/c12167416dbcd373c7e9c5816e274fe1c15b3633"},{"sha":"a2a3e335977b36c4688746fc426e8e8044e3df66","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"account: Add `hasValidAuth` selector, and use it.\n\nSmall convenience wrapper around the `tryGetValidAuth` selector we\njust added, for places where we don't actually use the auth object\nbut just want the boolean.","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/a2a3e335977b36c4688746fc426e8e8044e3df66"},{"sha":"9c38ece94aaa898f36f1686d0444812f5cb8b018","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"account: Replace empty-string fallback with assert, in getIdentity.\n\nThis selector actually has zero callers right now -- so we're free to\ndo with its semantics whatever we like!\n\n(We introduced this selector and the `Identity` type recently, and\nhaven't yet made the effort to adopt it widely.  We'll add a new\ncaller shortly, as we move callers off the empty-string semantics of\ngetAuth.)","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/9c38ece94aaa898f36f1686d0444812f5cb8b018"},{"sha":"696030ef0b12e7e45f311c64aa0e212d5017825c","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"account: Replace `getAuth` in a place that wants `getIdentity`.\n\nThis is the one place we use `getAuth` in another selector -- which is\na sure sign that we're not going to be making an API request with it,\nthe main legitimate use of an `Auth` object.","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/696030ef0b12e7e45f311c64aa0e212d5017825c"},{"sha":"d5f8246fb7e4f17619bb8c8dee266ace1d7d2936","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"account: Replace empty-string fallback with assert, in `getAuth`.\n\nEach remaining call site of this selector makes an assumption that\nthere is some active account.\n * Many use the return value to make an API request, which will\n   never work if `realm: ''`.\n * Many are in UI components displaying logged-in information.\n * A few are in UI components within the authentication flow;\n   these still assume a genuine value for `realm`.\n\nAnd those categories cover it -- I read through all the call sites,\nand those that didn't make this assumption I took care of in the\npreceding few commits so that they use something else instead.\n\nSo, make that assumption explicit.","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/d5f8246fb7e4f17619bb8c8dee266ace1d7d2936"},{"sha":"cace4fd088ec9e50ddcd1a4aa859895268901a16","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"account: Make `getAuth` return only real, authentication-bearing values.\n\nI read through all the call sites of `getAuth` (that remain after the\nchanges in the last half-dozen commits), and all of them other than\nthese two make an assumption that the returned Auth object has a real,\nvalid API key -- either they're in part of UI that displays logged-in\ninformation, or they promptly use the return value to make an\nauthenticated request to the server, or both.\n\nThese two don't really want an \"auth\" object so much as a realm and\noptional email, because they actually assume we don't have a valid\nAPI key -- they're both part of authentication flows.  But they want\nan `Auth` object to pass to the API bindings, so unpicking that will\nbe a bit more work; just make it a \"partial auth\" that is still of\ntype `Auth`.","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/cace4fd088ec9e50ddcd1a4aa859895268901a16"},{"sha":"a4546dea2331fc6e6973c6f973c67b1e3a87bdd2","author":{"name":"Greg Price","email":"79e2475f81a6317276bf7cbb3958b20d289b78df@zulipchat.com"},"message":"account: s/Valid//g in names; it's the invalid case that's special.\n\nIn general, when there's a value that might be a real, genuine Foo but\nmight also be an invalid Foo-like thing, it's best to scrupulously\nlabel that fact in the names chosen in the source code.  (Unless the\ncontext otherwise somehow makes this super clear.)\n\nThat's because inevitably when the name says it's a Foo, a person\nreading the code will often take the name at its word.  (If someone\ndoesn't, and assumes everything might be a lie until proven otherwise,\nit'll take them a huge effort to read very much code at all.)\n\nHistorically we hadn't done that with `getAuth` -- its return value\nmight have been a genuine, valid, logged-in auth object (one that\nactually carries authentication to a Zulip server), or despite the\nname it might have been an invalid one that had a dummy value (the\nempty string) in place of an API key.  So a few commits ago, when\nintroducing related functions that did deal only in valid auth\nobjects, we named them `tryGetValidAuth` and `hasValidAuth`, to make\nthe distinction explicit.\n\nNow `getAuth` lives up to its name.  So name these companion functions\nsimply `tryGetAuth` and `hasAuth`, to match.","distinct":false,"url":"https://api.github.com/repos/borisyankov/zulip-mobile/commits/a4546dea2331fc6e6973c6f973c67b1e3a87bdd2"}]}
{"actor":{"display_login":"borisyankov"}}