New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync Function expiry() fails if passed a constant numeric value #3452

Closed
JFlath opened this Issue Apr 16, 2018 · 1 comment

Comments

Projects
None yet
4 participants
@JFlath
Copy link
Collaborator

JFlath commented Apr 16, 2018

As reported by Fujio here: https://forums.couchbase.com/t/sg-2-0-ttl-expiry/16530

Seems the issue is in ReflectExpiry where we expect a numeric value not wrapped in a string to be float64. This is the case when parsed from incoming JSON, but not when specified directly in the Sync Function, where it comes through as int64.

The workaround would be to, as in the forum post, specify this as some other type. expiry("600") should also work.

@JFlath JFlath self-assigned this Apr 16, 2018

@JFlath

This comment has been minimized.

Copy link
Collaborator

JFlath commented Apr 16, 2018

Grabbing this, as I've got most of the fix (all 2 lines of it ;)) done from debugging anyway. Just need to throw together a test if poss.

JFlath added a commit that referenced this issue Apr 16, 2018

@snej snej added the in progress label Apr 16, 2018

@hideki hideki added the review label Apr 16, 2018

@adamcfraser adamcfraser added this to the 2.1.0 milestone Apr 16, 2018

@bbrks bbrks closed this in #3453 Apr 16, 2018

bbrks added a commit that referenced this issue Apr 16, 2018

Fix handling of constant in expiry() (Fixes #3452) (#3453)
* Fix handling of constant in expiry() (Fixes #3452)

* Add tests for ReflectExpiry

With thanks to @bbrks

OldSneerJaw added a commit to Kashoo/synctos that referenced this issue Apr 22, 2018

Issue #301: Change referenced Sync Gateway bug
The bug in question was first reported as issue [#3452](couchbase/sync_gateway#3452). The duplicate issue ([#3489](couchbase/sync_gateway#3489)) has since been closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment