Skip to content

cache user repositories locally #2770

Closed

Description

@shiftkey

See #2436 (comment)

We don't cache repositories retrieved from the API, so it's really slow on each usage (not just the first) when you have access to hundreds of repositories.

Might also need some design thought about managing the interactions (show cached repositories, while fetching new repositories to refresh, and then merging) so that the app refreshes without interrupting the user.

cc @desktop/design for feels

Activity

  1. joshaber commented on Sep 19, 2017

    @joshaber
    Contributor

    From an implementation perspective, there's a few things we should weigh:

    1. Cache in AppState. It's lost across relaunches, but it'd be an easy win.
    2. I'm a little surprised Chromium's caching isn't giving us more here. It might be worth looking into.
    3. Could/should we cache the JSON response vs. going through the work of storing them in a database?
  2. joshaber commented on Sep 19, 2017

    @joshaber
    Contributor

    @niik and I talked about this a bit, specifically around the race condition where you create a new repository on dotcom, go to clone it in Desktop, and it's missing because we haven't refreshed in time or invalidated the cache.

    This was at least part of the motivation for Classic Windows' clone design and it not caching data.

    The root problem here is that it takes a looooooooooong time to see your repositories. That's because we currently load all the pages before showing anything in the UI. It'd be nicer if we could progressively show repositories as we get them.

  3. iAmWillShepherd commented on Sep 19, 2017

    @iAmWillShepherd
    Contributor

    I'd prefer using the database since a user's repos shouldn't change too drastically. I believe the typical action is to add a repo...

  4. joshaber commented on Sep 19, 2017

    @joshaber
    Contributor

    since a user's repos shouldn't change too drastically

    While it's true that a user's repos don't change often, I think @niik's concern is that they're more likely to change right before you try to clone. For example:

    1. Susan creates a new repo on GitHub.com.
    2. Susan goes to GitHub Desktop to clone it.
    3. It's not in her list because Desktop hasn't refreshed again yet.
    4. Susan has to manually refresh.
    5. She now has to wait while it refreshes.

    In that case, caching hurts more than it helps. I think @niik's point is that the nature of clone makes them more likely to run into that.

  5. niik commented on Sep 20, 2017

    @niik
    Member

    In that case, caching hurts more than it helps. I think @niik's point is that the nature of clone makes them more likely to run into that.

    ☝️ exactly. And the same goes for organizations. "Let's get started on this new project team! I've created the super-app repo, go clone it".

  6. shiftkey commented on Dec 28, 2017

    @shiftkey
    MemberAuthor

    This idea is interesting for the future, but this is beyond the scope of our current roadmap.

    I added the future-proposal label to this issue and closed it so that we won't get overwhelmed with our backlog! We will revisit this in our next planning session.

  7. billygriffin commented on Nov 30, 2018

    @billygriffin
    Contributor

    Superseded by @niik's work in #5686 so I'm going to remove future-proposal here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions