Skip to content

Commit a4bbb63

Browse files
committed
store [nfc]: Make account-exists assumption explicit in some dartdocs
In particular: GlobalStore.loadPerAccount GlobalStore.doLoadPerAccount UpdateMachine.load The first two already have an `assert` that the account exists, and the third has a ! null-check. They're called in a chain from two places, and we have the account in both: the initial account load and the reload (GlobalStore._reloadPerAccount).
1 parent fa69d00 commit a4bbb63

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/model/store.dart

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ abstract class GlobalStore extends ChangeNotifier {
145145
oldStore?.dispose();
146146
}
147147

148-
/// Load per-account data for the given account, unconditionally.
148+
/// Load per-account data for the given account ID, unconditionally.
149+
///
150+
/// The account for `accountId` must exist.
149151
///
150152
/// This method should be called only by the implementation of [perAccount].
151153
/// Other callers interested in per-account data should use [perAccount]
@@ -189,7 +191,9 @@ abstract class GlobalStore extends ChangeNotifier {
189191
return store;
190192
}
191193

192-
/// Load per-account data for the given account, unconditionally.
194+
/// Load per-account data for the given account ID, unconditionally.
195+
///
196+
/// The account for `accountId` must exist.
193197
///
194198
/// This method should be called only by [loadPerAccount].
195199
Future<PerAccountStore> doLoadPerAccount(int accountId);
@@ -909,7 +913,10 @@ class UpdateMachine {
909913
store.updateMachine = this;
910914
}
911915

912-
/// Load the user's data from the server, and start an event queue going.
916+
/// Load data for the given account ID from the server,
917+
/// and start an event queue going.
918+
///
919+
/// The account for `accountId` must exist.
913920
///
914921
/// In the future this might load an old snapshot from local storage first.
915922
static Future<UpdateMachine> load(GlobalStore globalStore, int accountId) async {

0 commit comments

Comments
 (0)