DarthBenro008/rchore

rChore shows no tasks if we query for tasks after access_token has expired

DarthBenro008 opened this issue · 0 comments

  • rChore shows No tasks if we query after access_token has expired.
  • The subsequent query shows correct tasks (wrong results for first time after token expiry)

Relevant Code:

get_new_access_token(&self.localdb)?;
let token = self.localdb.get_token()?;
let new_client = GoogleApiClient::new_token_client(token);
self.client = new_client;
self.fetch_all_tasks(show_hidden)?;
return Ok(TaskResponse {
etag: "".to_string(),
kind: "".to_string(),
items: [].to_vec(),
});
}
let tasks_response = resp.json::<TaskResponse>()?;
Ok(tasks_response)

Solution:

  • Create a middleware cache check in GoogleApiClient