Skip to content

Commit

Permalink
preliminary support for jimmejardine#268 : the Create/Join code did e…
Browse files Browse the repository at this point in the history
…xist, but ASSERT checks would fail, at least in BEDUG BUILDs, before the library would be set up properly before.

Problems still to solve:

- joining a sync path which is already used by another of your libraries: collision!
- joining a sync path where the library ID is the same as one of your already existing ones, because
  + this was EITHER an old sync directory for that lib once
  + OR the sync path happens to have the same Id/whatever because someone else created it (or you've been messing around with sync paths and testing Qiqqa, @GerHobbelt ;-) )
- give some user grokkable feedback when you JOIN but DO NOT see the change, because it somehow decides that one is already in your library list. This is now happening silently.
- might want to ASK if that was intentional before overwriting another library's sync path or changing the library name through CREATE and then editing the title + description in there.
  • Loading branch information
GerHobbelt committed Jan 2, 2021
1 parent e7812e5 commit 8934713
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,24 @@ public void InitAllLoadedLibraries()
{
WebLibraryDetail web_lib = pair.Value;
Library library = web_lib.Xlibrary;
ASSERT.Test(library == null);
// only set up a Library instance when there isn't already one.
// `library` may already have been set up in a previous call to this API
// at application start; *this* call therefor MUST be due to the user
// CREATING or JOINING another Intranet Library then!
if (library == null)
{
if (ShutdownableManager.Instance.IsShuttingDown)
{
Logging.Info("InitAllLoadedLibraries: Breaking out of library loading loop due to application termination");
break;
}

if (ShutdownableManager.Instance.IsShuttingDown)
library = web_lib.Xlibrary = new Library(web_lib);
}
else
{
Logging.Info("InitAllLoadedLibraries: Breaking out of library loading loop due to application termination");
break;
Logging.Info($"InitAllLoadedLibraries: Initializing the local library for library Id: '{web_lib.Id}', Title: '{web_lib.Title}'");
}

library = web_lib.Xlibrary = new Library(web_lib);
library.BuildFromDocumentRepository(web_lib);
}
}
Expand Down

0 comments on commit 8934713

Please sign in to comment.