Skip to content
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

Updating a design doc view map function does not take effect #1758

Closed
raghusarangapani opened this issue May 15, 2017 · 0 comments
Closed

Updating a design doc view map function does not take effect #1758

raghusarangapani opened this issue May 15, 2017 · 0 comments

Comments

@raghusarangapani
Copy link

The issue was originally reported against android:
https://github.com/couchbase/couchbase-lite-android/issues/1139

Test case:

  1. Add 10 docs to the client with content
  2. Add 5 docs to the client without content
  3. Create design doc version 1 to fetch doc._id, doc._rev for docs with content
  4. Run a query and check for 10 expected docs with design doc version 1
  5. Update design doc to version 2 to fetch doc._id, doc._rev for docs with no content
  6. Run a query and check for 5 expected docs with design doc version 2
    -> Even though design doc is updated to version 2, the second query will use design doc 1 and return 10 docs instead of 5

Steps to reproduce:

pytest -k test_design_doc_update --liteserv-platform=macosx --liteserv-version=1.4.0-3 --liteserv-host=localhost --liteserv-port=59840 --liteserv-storage-engine=SQLite --sync-gateway-version=1.4.2-368 --sync-gateway-mode=cc --server-version=5.0.0-2873 testsuites/listener/shared/client_sg/


  • Version: 1.4.0-3
  • Client OS: mac
  • Server: SG 1.4.2-368
@djpongh djpongh added this to the 1.4.1 milestone Jun 2, 2017
@pasin pasin added ready and removed icebox labels Sep 22, 2017
pasin added a commit that referenced this issue Sep 23, 2017
If view’s properties is not nil, always compare the version (SHA1 hash of the new view’s properties) whether it is the same as the current version or not. If version is not the same, recompile the map/reduce fn and re-register the map/reduce fn.

#1758
pasin added a commit that referenced this issue Sep 23, 2017
If view’s properties is not nil, always compare the version (SHA1 hash of the new view’s properties) whether it is the same as the current version or not. If version is not the same, recompile the map/reduce fn and re-register the map/reduce fn.

#1758
pasin added a commit that referenced this issue Sep 28, 2017
* Fixed bug that doesn’t return NOT_FOUND status when compiling the design doc and there is no design doc or map function defined. Also support the case that there is a native design doc like view defined, then the design doc is queries through the REST API.

* Added isDesignDoc flag to bypass design doc compilation process (check existing and version) if the view is not a design doc view.

#1758
pasin added a commit that referenced this issue Sep 28, 2017
* Fixed bug that doesn’t return NOT_FOUND status when compiling the design doc and there is no design doc or map function defined. Also support the case that there is a native design doc like view defined, then the design doc is queries through the REST API.

* Added isDesignDoc flag to bypass design doc compilation process (check existing and version) if the view is not a design doc view.

#1758
@pasin pasin added review and removed ready labels Sep 29, 2017
@snej snej closed this as completed in 0ab34be Oct 4, 2017
@snej snej removed the review label Oct 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants