From 977c03f5f7b1e4a838820ed49265ce28c7b8ab98 Mon Sep 17 00:00:00 2001
From: ipfans <363344+ipfans@users.noreply.github.com>
Date: Thu, 31 Dec 2020 10:14:23 +0800
Subject: [PATCH] bump v0.2.0
---
CHANGELOG.md | 16 +++++++++++++++-
client.go | 3 ++-
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 326492e..7ca7ddb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,18 @@
## [Unreleased]
+
+## [v0.2.0] - 2020-12-30
+### Features
+- compensation mechanism for refresh token
+
+
+
+## [v0.2.0-beta.1] - 2020-12-29
+### Features
+- ExponentialBackOff support for API.
+
+
## [v0.1.3] - 2020-12-29
### Bug Fixes
@@ -50,7 +62,9 @@
- More powerful API Client
-[Unreleased]: https://github.com/yunjuiot/tuyacloud/compare/v0.1.3...HEAD
+[Unreleased]: https://github.com/yunjuiot/tuyacloud/compare/v0.2.0...HEAD
+[v0.2.0]: https://github.com/yunjuiot/tuyacloud/compare/v0.2.0-beta.1...v0.2.0
+[v0.2.0-beta.1]: https://github.com/yunjuiot/tuyacloud/compare/v0.1.3...v0.2.0-beta.1
[v0.1.3]: https://github.com/yunjuiot/tuyacloud/compare/v0.1.2...v0.1.3
[v0.1.2]: https://github.com/yunjuiot/tuyacloud/compare/v0.1.1...v0.1.2
[v0.1.1]: https://github.com/yunjuiot/tuyacloud/compare/v0.1.0...v0.1.1
diff --git a/client.go b/client.go
index 6573a47..79e3415 100644
--- a/client.go
+++ b/client.go
@@ -120,7 +120,8 @@ func (c *Client) Parse(res *http.Response, resp interface{}) error {
return err
}
if !body.Success {
- // compensation mechanism for refresh token
+ // compensation mechanism for token invalid.
+ // e.g. tuya restarts its server all token will expires right now.
if body.Code == 1010 || body.Code == 1011 {
c.lock.Lock()
c.storage.Refresh(c)