diff --git a/CHANGELOG.md b/CHANGELOG.md index badd04d..4d0660a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [v0.12.2] +- updated long-poll status codes [#103](https://github.com/xmidt-org/gungnir/pull/103) +- fixed long-poll first get [#104](https://github.com/xmidt-org/gungnir/pull/104) +- updated codex-db to v0.5.1 [#104](https://github.com/xmidt-org/gungnir/pull/104) + ## [v0.12.1] - Add timeouts to long-poll [#102](https://github.com/xmidt-org/gungnir/pull/102) diff --git a/go.mod b/go.mod index c67411f..b16219f 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/stretchr/testify v1.4.0 github.com/ugorji/go/codec v1.1.7 github.com/xmidt-org/bascule v0.7.0 - github.com/xmidt-org/codex-db v0.5.0 + github.com/xmidt-org/codex-db v0.5.1 github.com/xmidt-org/voynicrypto v0.1.1 github.com/xmidt-org/webpa-common v1.5.1 github.com/xmidt-org/wrp-go v1.3.4 diff --git a/go.sum b/go.sum index 8ba87c5..ccb8553 100644 --- a/go.sum +++ b/go.sum @@ -279,8 +279,8 @@ github.com/xmidt-org/bascule v0.5.0/go.mod h1:D2DuXSMa5+OpveCtaSWp0+/tmnxZqfYhkC github.com/xmidt-org/bascule v0.7.0 h1:TUbSKq68CzutTXYh5hq8mhMCHeYdIXaUffx3qCMo1yE= github.com/xmidt-org/bascule v0.7.0/go.mod h1:D2DuXSMa5+OpveCtaSWp0+/tmnxZqfYhkCC1oCzLZdI= github.com/xmidt-org/capacityset v0.1.1/go.mod h1:rJ00PZmbkdroZMiL0DOMzgkrwJddVfR1I5LmRX6YG2Y= -github.com/xmidt-org/codex-db v0.5.0 h1:TFFzuSwtV0pubtKeqjAsk/qXG4d36Dqwf4Hdr42qt8c= -github.com/xmidt-org/codex-db v0.5.0/go.mod h1:vQpkbRzvaOCpiObVv8e5vRHgW08w1o8J1GtgRheulwk= +github.com/xmidt-org/codex-db v0.5.1 h1:n3NCsR0npQDLGd0ZndnrjCwei3vY3Zs09ypGU61KYRw= +github.com/xmidt-org/codex-db v0.5.1/go.mod h1:vQpkbRzvaOCpiObVv8e5vRHgW08w1o8J1GtgRheulwk= github.com/xmidt-org/voynicrypto v0.1.1 h1:hMqSOgYzpkbUUpgKxJcPTVRGdmDY0jem8PufsUikh+c= github.com/xmidt-org/voynicrypto v0.1.1/go.mod h1:YSw/rwukAL2tpkB6wSeuoCRBOIK2mhpV4OzJLX292fs= github.com/xmidt-org/webpa-common v1.1.0/go.mod h1:oCpKzOC+9h2vYHVzAU/06tDTQuBN4RZz+rhgIXptpOI= diff --git a/primaryHandler.go b/primaryHandler.go index b3deeb2..151d9ec 100644 --- a/primaryHandler.go +++ b/primaryHandler.go @@ -100,6 +100,12 @@ func (app *App) getDeviceInfoAfterHash(deviceID string, requestHash string, ctx http.StatusInternalServerError} } + hash, err = app.eventGetter.GetStateHash(records) + if err != nil { + logging.Error(app.logger, emperror.Context(err)...).Log(logging.MessageKey(), "Failed to get latest hash from records", logging.ErrorKey(), err.Error()) + } + events = app.parseRecords(records) + after := time.After(app.longPollTimeout) // TODO: improve long poll logic for len(events) == 0 {