Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-6450

Finalize doc editing API and implementation

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta
    • Fix Version/s: bug-backlog
    • Component/s: ns_server
    • Security Level: Public
    • Labels:
    • Triage:
      Untriaged
    • Sprint:
      02/Sep/2013 - 20/Sep/2013

      Description

      We need to:

      • avoid loading and displaying blobs on UI
      • avoid seeing deleted docs
      • handle warmup, node being down in REST API implementation and UI
      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        tgrall Tug Grall (Inactive) added a comment -

        As a follow up to our discussion...

        We have some issue with the console where for example the user stores: (using the PHP SDK but more or less the same with other)

        $cb->set("T2","2.0");

        The data on disk looks like (couchstore dump)
        id: T2
        rev: 6
        content_meta: 128
        cas: 76870971085289, expiry: 0, flags: 0
        data: (snappy) 2.0

        When I read the value is:

        echo( $cb->get("T2") );
        2.0

        But in the Couchbase console the value is showed has:
        2

        Show
        tgrall Tug Grall (Inactive) added a comment - As a follow up to our discussion... We have some issue with the console where for example the user stores: (using the PHP SDK but more or less the same with other) $cb->set("T2","2.0"); The data on disk looks like (couchstore dump) id: T2 rev: 6 content_meta: 128 cas: 76870971085289, expiry: 0, flags: 0 data: (snappy) 2.0 When I read the value is: echo( $cb->get("T2") ); 2.0 But in the Couchbase console the value is showed has: 2
        Hide
        tgrall Tug Grall (Inactive) added a comment -

        Another issue that I have found that is relate to this global work is:

        If you store:
        $cb->set("T3","2,0");

        On disk it is:
        id: T3
        rev: 8
        content_meta: 131
        cas: 76870971228863, expiry: 0, flags: 0
        data: (snappy) 2,0

        In the console : document view :
        "SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data (Document is invalid JSON)"
        Does not show any valye (where it should show a "base64" string

        In the console : preview document in the view editor:
        "Lost connection to server at 127.0.0.1:8091. Repeating in 1 seconds. Retry now" and nothing is showed

        The XHR (for example http://127.0.0.1:8091/couchBase/default/T3?_=1378774035807) returns 2,0 where it "should" be a base64 not a JSON "thing"

        Show
        tgrall Tug Grall (Inactive) added a comment - Another issue that I have found that is relate to this global work is: If you store: $cb->set("T3","2,0"); On disk it is: id: T3 rev: 8 content_meta: 131 cas: 76870971228863, expiry: 0, flags: 0 data: (snappy) 2,0 In the console : document view : "SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data (Document is invalid JSON)" Does not show any valye (where it should show a "base64" string In the console : preview document in the view editor: "Lost connection to server at 127.0.0.1:8091. Repeating in 1 seconds. Retry now" and nothing is showed The XHR (for example http://127.0.0.1:8091/couchBase/default/T3?_=1378774035807 ) returns 2,0 where it "should" be a base64 not a JSON "thing"
        Hide
        alkondratenko Aleksey Kondratenko (Inactive) added a comment - - edited

        Tug, issue we discussed above indeed applies to UI. But there's also full stack issue. And IMHO larger one.

        I've cc-ed some bosses so that they're aware too. So let me elaborate and raise that.

        Our product is positioned as "document database". Yet what you've shown me php sdk doing is:

        • when number 2.0 is passed to set(), it get's silently converted to array of bytes "2" which is stored on server. And we treat that as valid json (well at least in views; we've long had plans to have flag that would allow memcached to refuse non-json values). So map function will see that as 2.0 (js numbers are always floating point). So far good.
        • when string "2.0" is sent, it still gets sent as array of bytes "2.0" which is stored on server. This time map function will see number again. Which is arguably not good. Application is seeing string, yet view is seeing number.
        • when string "2gargage" is sent it gets to server as "2gargage". And this is not valid json (note, quotes are mine and are not part of value). So views will see that (due to some arguably questionable decision) as base64 encoding of that octet string.

        My point is: if we want to seriously be json storage, we should consider doing something on clients as well. So that for example "asdsad" is sent as "\"asdasd\"" (quoted to be json string). So that views see roughly same value as your app.

        This is in my opinion larger issue than UI problem that I'm going to fix soon. And let me note again that there is no plan at all to support displaying let alone editing arbitrary values (blobs) on UI. We'll only limit ourselves to json values. And quite possibly even not all types of json values.

        Show
        alkondratenko Aleksey Kondratenko (Inactive) added a comment - - edited Tug, issue we discussed above indeed applies to UI. But there's also full stack issue. And IMHO larger one. I've cc-ed some bosses so that they're aware too. So let me elaborate and raise that. Our product is positioned as "document database". Yet what you've shown me php sdk doing is: when number 2.0 is passed to set(), it get's silently converted to array of bytes "2" which is stored on server. And we treat that as valid json (well at least in views; we've long had plans to have flag that would allow memcached to refuse non-json values). So map function will see that as 2.0 (js numbers are always floating point). So far good. when string "2.0" is sent, it still gets sent as array of bytes "2.0" which is stored on server. This time map function will see number again. Which is arguably not good. Application is seeing string, yet view is seeing number. when string "2gargage" is sent it gets to server as "2gargage". And this is not valid json (note, quotes are mine and are not part of value). So views will see that (due to some arguably questionable decision) as base64 encoding of that octet string. My point is: if we want to seriously be json storage, we should consider doing something on clients as well. So that for example "asdsad" is sent as "\"asdasd\"" (quoted to be json string). So that views see roughly same value as your app. This is in my opinion larger issue than UI problem that I'm going to fix soon. And let me note again that there is no plan at all to support displaying let alone editing arbitrary values (blobs) on UI. We'll only limit ourselves to json values. And quite possibly even not all types of json values.

          People

          • Assignee:
            alkondratenko Aleksey Kondratenko (Inactive)
            Reporter:
            alkondratenko Aleksey Kondratenko (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Agile

                Gerrit Reviews

                There are no open Gerrit changes