quill icon indicating copy to clipboard operation
quill copied to clipboard

Support multiple blogs

Open vickychijwani opened this issue 7 years ago • 4 comments

Pro users would like the option to sign in to multiple ~~accounts~~ blogs and switch between them seamlessly.


Task list:

  • [x] Rework storage architecture alongside other breaking changes for Ghost 1.0 (#162)
  • [ ] Build UI for adding / removing blogs and switching among them
  • [ ] Remove android:launchMode="singleTop" attribute from LoginActivity in the manifest
  • [ ] Add lots of logging in AccountManager to help debug any issues that come up
  • [ ] Handle scenario where the password has changed (or Ghost Auth code has expired)
  • [ ] Test cases:
    • [ ] Trying to add a new account with a blog that was already added earlier (only allow a single account per blog)
    • [ ] Preserve the data Realm in the case where, e.g., credentials expire
    • [ ] Delete the data Realm when a blog is removed (i.e., logged out)

vickychijwani avatar Nov 05 '16 05:11 vickychijwani

*multiple ghost blogs

nqthqn avatar Nov 05 '16 21:11 nqthqn

@natsn right, sorry, that's what I intended to write down.

vickychijwani avatar Nov 06 '16 12:11 vickychijwani

Status update: work on this has been stalled so far because Ghost 1.0 is coming out in a few weeks, with big changes. This will be tackled once things settle down.

vickychijwani avatar Feb 18 '17 21:02 vickychijwani

One of the hardest parts of this feature is done (in the wip-ghost-1.0 branch currently) - the data layer is now equipped to handle multiple blogs 🙂

The way this works is:

  • Each blog's data is stored in a separate Realm file, named with the base-64 encoded URL of that blog
  • The main (default) Realm stores the metadata for all these blogs, like the blog URLs, credentials, logged-in status (which is false if the credentials that used to work are now known to be expired).
  • At most one blog is considered active at any time. If the active blog has its loggedIn property set to false, Quill will assume at start-up time that the credentials are known to be expired (that's how loggedIn becamse false in the first place) and will prompt for them again. At the moment this prompt is not dismissable, and I'm not sure if it should be.

vickychijwani avatar Aug 04 '17 23:08 vickychijwani