You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by robertkowalski <gi...@git.apache.org> on 2014/11/14 16:10:56 UTC

[GitHub] couchdb-fauxton pull request: Fix bulk-delete on all-doc-page

GitHub user robertkowalski opened a pull request:

    https://github.com/apache/couchdb-fauxton/pull/150

    Fix bulk-delete on all-doc-page

    On Couch 1.6 `/_bulk_docs` returned `ok: true` when the request was an
    success. On 2.0 the ok property is missing:
    
    Example success message on 2.0:
    ```
    [{"id":"Brocket","rev":"6-b6fa9e703c3eb92aa9c3a49cedf1e8c2"}]
    ```
    
    Example error message on 2.0:
    ```
    [{"id":"Blaggie-System","error":"conflict",
      "reason":"Document update conflict."}]
    ```
    
    Steps to reproduce the error in Fauxton:
    
     - select 1 document in the all_docs screen
     - click the trash icon to delete it
     - click ok to delete it
     - you are able to click the trash icon again and if you do, you
       get an error

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/robertkowalski/couchdb-fauxton COUCHDB-2462-bulk-delete-broken

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-fauxton/pull/150.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #150
    
----
commit 450bbb50475320d6dc50e7580d65a0f5ea271e79
Author: Robert Kowalski <ro...@apache.org>
Date:   2014-11-14T15:04:31Z

    Fix bulk-delete on all-doc-page
    
    On Couch 1.6 `/_bulk_docs` returned `ok: true` when the request was an
    success. On 2.0 the ok property is missing:
    
    Example success message on 2.0:
    ```
    [{"id":"Brocket","rev":"6-b6fa9e703c3eb92aa9c3a49cedf1e8c2"}]
    ```
    
    Example error message on 2.0:
    ```
    [{"id":"Blaggie-System","error":"conflict",
      "reason":"Document update conflict."}]
    ```
    
    Steps to reproduce the error in Fauxton:
    
     - select 1 document in the all_docs screen
     - click the trash icon to delete it
     - click ok to delete it
     - you are able to click the trash icon again and if you do, you
       get an error

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Fix bulk-delete on all-doc-page COUC...

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/150#issuecomment-63308875
  
    Another thing, maybe we should add some simple nightwatch tests for this? This has been a section that has failed before. At least with the nightwatch tickets we get some simple tests to prove this is always working.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Fix bulk-delete on all-doc-page COUC...

Posted by michellephung <gi...@git.apache.org>.
Github user michellephung commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/150#issuecomment-63125428
  
    Hi,
    
    This works for the bulk-trash can, but if I click on the document's trashcan with only one document present, the bulk trashcan button is still clickable (when there are no documents present), resulting in an error if you click on the bulk-trashcan.
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Fix bulk-delete on all-doc-page COUC...

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski closed the pull request at:

    https://github.com/apache/couchdb-fauxton/pull/150


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Fix bulk-delete on all-doc-page COUC...

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/150#issuecomment-63460545
  
    merged as 235d544517f64941a796e382bbc67b520a241fed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Fix bulk-delete on all-doc-page COUC...

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/150#issuecomment-63309937
  
    good point - using promises now - did a lot of node the weekend and was still in callback-mode :) much cleaner & leaner now!
    
    +1 on writing a nightwatch test for it - suggestion how to proceed: if we get nightwatch merged until tomorrow morning, wait for nightwatch on master and add test. if we haven't merged until then, merge the fix and add a test afterwards once nightwatch is added.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Fix bulk-delete on all-doc-page COUC...

Posted by benkeen <gi...@git.apache.org>.
Github user benkeen commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/150#issuecomment-63126459
  
    I get an error whenever using the bulk delete: `Uncaught TypeError: Cannot read property 'remove' of undefined` on line 376 of documents/views.js


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Fix bulk-delete on all-doc-page COUC...

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/150#issuecomment-63310206
  
    Nice @robertkowalski thats great work. I'm +1 on this and your merge plan as well.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Fix bulk-delete on all-doc-page COUC...

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/150#issuecomment-63307280
  
    @robertkowalski I don't think we should solve this issue using async. Async is used when callbacks are the default way of working with asynchronous functions. In Fauxton we use promises to handle asynchronous functions.
    
    To solve this using promises you can have the removeDocument return a promise (`$.Deferred()`) which gets resolved once the fadeout has occurred. Then use `$.when` for a final callback once everything is complete.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Fix bulk-delete on all-doc-page COUC...

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/150#issuecomment-63300456
  
    wow, nice async race condition:
    
    the fade out with the callback which removed a view was slower than a refetch of missing documents to adjust the count of documents per page again.
    
    can you look again? 
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---