Skip to content
This repository has been archived by the owner on Feb 12, 2019. It is now read-only.

Commit

Permalink
Revert "libkbfs: actually invalidate favorites cache"
Browse files Browse the repository at this point in the history
This reverts commit 95ac1e2.
  • Loading branch information
aaazalea committed Nov 5, 2018
1 parent c6c3ac3 commit 4dcbacd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
9 changes: 5 additions & 4 deletions libkbfs/favorites.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ func (f *Favorites) handleReq(req *favReq) (err error) {
// Fetch a new list if:
// * The user asked us to refresh
// * We haven't fetched it before
if req.refresh || f.cache == nil {
// * The user wants the list of favorites. TODO: use the cached list
// once we have proper invalidation from the server.
if req.refresh || f.cache == nil || req.favs != nil {
folders, err := kbpki.FavoriteList(req.ctx)
if err != nil {
return err
Expand Down Expand Up @@ -338,9 +340,8 @@ func (f *Favorites) RefreshCache(ctx context.Context) {
}
}

// Get returns the logged-in user's list of favorites. It uses the cache.
// TODO: decide on behavior if we've gotten an invalidation but not an updated
// list yet
// Get returns the logged-in users list of favorites. It
// doesn't use the cache.
func (f *Favorites) Get(ctx context.Context) ([]Favorite, error) {
if f.disabled {
session, err := f.config.KBPKI().GetCurrentSession(ctx)
Expand Down
10 changes: 0 additions & 10 deletions libkbfs/keybase_daemon_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func (k *KeybaseDaemonRPC) addKBFSProtocols() {
keybase1.NotifyPaperKeyProtocol(k),
keybase1.NotifyFSRequestProtocol(k),
keybase1.NotifyTeamProtocol(k),
keybase1.NotifyFavoritesProtocol(k),
keybase1.TlfKeysProtocol(k),
keybase1.ReachabilityProtocol(k),
keybase1.ImplicitTeamMigrationProtocol(k),
Expand Down Expand Up @@ -328,7 +327,6 @@ func (k *KeybaseDaemonRPC) OnConnect(ctx context.Context,
Service: true,
Team: true,
Chatkbfsedits: true,
Favorites: true,
})
if err != nil {
return err
Expand Down Expand Up @@ -455,11 +453,3 @@ func newNotifyServiceHandler(config Config, log logger.Logger) keybase1.NotifySe
s := &notifyServiceHandler{config: config, log: log}
return s
}

// FavoritesChanged implements keybase1.NotifyFavoritesClient
func (k *KeybaseDaemonRPC) FavoritesChanged(ctx context.Context,
uid keybase1.UID) error {
k.log.Debug("Received FavoritesChanged RPC.")
k.config.KBFSOps().RefreshCachedFavorites(ctx)
return nil
}

0 comments on commit 4dcbacd

Please sign in to comment.