@@ -1895,7 +1895,10 @@ Boards.helpers({
18951895 { _id : defaultId } ,
18961896 { $setOnInsert : this . defaultSwimlaneFields ( ) } ,
18971897 ) ;
1898- return ReactiveCache . getSwimlane ( { _id : defaultId } ) ;
1898+ return (
1899+ ( await ReactiveCache . getSwimlane ( { _id : defaultId } ) ) ||
1900+ ( Meteor . isServer ? await Swimlanes . findOneAsync ( defaultId ) : undefined )
1901+ ) ;
18991902 } ,
19001903
19011904 // Fields for an upsert-inserted default swimlane. archived/type must be set
@@ -1910,9 +1913,13 @@ Boards.helpers({
19101913 async getDefaultSwimlineAsync ( ) {
19111914 // Issue #1971: prefer a NON-archived swimlane (see getDefaultSwimline).
19121915 const { pickDefaultSwimlane } = require ( './lib/defaultSwimlane' ) ;
1913- let result = pickDefaultSwimlane (
1914- await ReactiveCache . getSwimlanes ( { boardId : this . _id } ) ,
1915- ) ;
1916+ // On the server this can run immediately after creating a helper board and
1917+ // its first swimlane. The reactive cache may still hold the pre-insert
1918+ // empty result, so use the authoritative collection in server methods.
1919+ const swimlanes = Meteor . isServer
1920+ ? await Swimlanes . find ( { boardId : this . _id } ) . fetchAsync ( )
1921+ : await ReactiveCache . getSwimlanes ( { boardId : this . _id } ) ;
1922+ let result = pickDefaultSwimlane ( swimlanes ) ;
19161923 if ( result === undefined && Meteor . isServer && this . _id ) {
19171924 // Issue #6382: never auto-create swimlanes from the client (see
19181925 // getDefaultSwimline) — only the server may insert the default one.
0 commit comments