I should be able to update my Space to the current version of its App

(User Story, To be Fixed , Priority: Critical, Test Status: No automated tests yet , Reported By Justin du Coeur, )
Summary: By now, we display the info that you're out of date, but there is no way to update!
The hard part here is mainly the Shadows. We need to detect what has changed, and update the Shadows accordingly. This includes:
  • If a new Model has been added, add its Shadow.
  • If a new Page has been added, add its Shadow.
  • If a Model or Page has been removed, and the Shadow is unaltered, remove it.
We need to think about this more carefully! Make sure all the Shadow edge cases are dealt with!
We also need to define a proper concept of a "release". Currently, there is no notion of what the changes to an App are ready to go. Should this relate to Experiment Mode? Maybe.
There should be a proper Manage Apps permission, which Owner and Managers have.

Notes from my Diary

None of this is gospel, but it needs thinking through. Some of it is more about testing Apps and edge cases.
  • Hammer on more use cases of Extract App, and see if complex stuff works properly. There are probably more bugs to catch yet.
  • Introduce a new API entry point, CheckAppVersions(), which goes through all of the Apps for this Space, requests GetSpaceVersion() for each of them, and returns the old and new versions and timestamps for any that are out of date.
  • At Client load time, if I am the Space Owner, but not blocking page load, call CheckAppVersions(). If any turn out to be out of date, flash a message to that effect, showing the version and timestamps.
  • Enhance AppsSpacePlugin and AppsPure to compute the diff for an App update. This needs to load the specified version of the App, and add any shadows needed for changes. I think we need shadows for any Models, Types and Properties added in the new version, but that needs careful examination.
  • Enhance AppsSpacePlugin and AppsFunctionsImpl with a new UpdateApp command, that takes a list of App ID / Version pairs, and calls the new stuff to update them.
  • Enhance the flashed message with a button to update the Apps using UpdateApp().
  • Specifically test: if I delete a Property from the parent App, do the usages in the child Spaces keep working okay? I expect them to do so.
  • Can I delete a Property from a shadow Model? Will that work as intended? Is the server code properly set up to not delete the Property itself if it is being used in a shadow?
  • Post a reminder of the LARP App.
  • Choose the next App to document, extract and publicize.
  • In the LARP App, All Plots et al are only showing the concrete Plots! It should be using _tagsForProperty to show all the ones that have been referenced. This should also be true of Factions, etc.
  • Okay: now rebuild The Subway Game, as quickly as possible, using the new system.
  • In AppsSpacePlugin, adjust addApp() to cope with updating an existing App. Instead of rejecting if the app already exists, it does so if the app exists and the requested version is the same as the one we already have.
  • Modify modelsToShadow() to check whether each App Model is already shadowed. (We probably need to build up a map of existing Shadowed Models in the Space.)
  • Modify addFilledAppPure() to cope with an App that already exists in the Space. In this case, it needs to remove the old version of the App from both state.apps and state.appInfo. It needs to be a bit subtler about the notion that stuff from the App already exists. It appears to already be right for the Models (but check this). When copying the Types and Properties, though, it needs to check whether they are already shadowed. (These have the same IDs for the shadow, so they’re easy to check.)
  • Introduce a new API, AppsFunctions.updateApp(), which takes both an App ID and the version to update to. It calls addApp() with this version, which will use the above changes.
  • Enhance ExtractAppTests to try this stuff out! At the end, enhance the App, and then call update to bring it up to snuff.
  • Add an Update button with the message, which calls updateApp().
  • QI.bu6oc49: Found another bug: I can’t access the Stylesheet Link from Things I create in the child. That’s pretty serious, actually, especially if the lack of it shadowing properly is the cause.
  • Bug in LARP App: Factions should be Set of Tag, not Set of Thing. Ditto for Bluesheets and Items. I’m realizing that this App, being based on the extremely old ARC, has some bad design baked into it.
  • General takeaway from NELCO: many people agree that, while my LARP App is interesting, the system that really wants Querki is Accelerant, which has lots of games, all using basically the same system, all building their own little bespoke websites. Investigate this! Talk to, eg, Lackey, Tara.