I'm testing on a Galaxy S3 running 4.3. I'm trying to get an emulator
running 4.4.2 up, but it is not starting correctly.

The test code does a put for the database, which returns 412 meaning it
already exists. Then a put for a design document at _design/reading which
returns a 409, which I'm taking to mean a version already exists. Finally
it does a get for _design/reading/_view/by_time. This returns an error: {
error: 'not_found', reason: 'Router unable to route request to
do_GET_DesignDocumentjava.lang.reflect.InvocationTargetException' }.

I have a link in the app that access that same url,
/wells/_design/reading/_view/by_time, and it is returning a 404.

cblite.getURL( function( err, url ) {
  var adapter = App.__container__.lookup('store:main').adapterFor(
'application' )
  url = url.substring( 0, url.length - 1 )
  alert( url )
  Ember.set( adapter, 'host', url )

  // Without this I get: "ip: Syntax Error: Unexpected end of input"
  var xmlHttp = new XMLHttpRequest()
  xmlHttp.open( 'GET', url, false )
  xmlHttp.send( null )
  alert( 'XMLHttpRequest get: ' + xmlHttp.responseText )

  var coax = require( 'coax' )
  var db = coax( [url, 'wells'] )

  db.put( function( err, res ) {
    if( err && err.status != 412 ) {
      alert( "ip:" + err )
    } else {
      db.get( function( err, res ) {
        if( err ) {
          alert( "ig:" + err )
        } else {
          var design = "_design/reading"
          var views = {
            views: {
              by_time: {
                map: function( doc ) {
                  if( doc.type == 'reading' ) {
                    d = new Date( doc.time )
                    emit( [d.getFullYear(), d.getMonth(), d.getDate(),
d.getHours(), d.getMinutes()], doc )
                  }
                }.toString()
              }
            }
          }
          db.put( design, views, function( err, info ) {
            if( err && err.status != 409 ) {
              alert( "pv:" + err.status )
            } else {
              var view = db( [design, '_view'] )
              view.get( 'by_time', function( err, res ) {
if( err ) {
                  for( prop in err ) {
                    alert( "gv:" + prop + " : " + err[prop] )
                  }
                } else {
                  alert( res )
}
              } )
            }
          } )
        }
      } )
    }
  } )
} )

-Will



On Mon, May 19, 2014 at 7:38 PM, J. Chris Anderson <[email protected]>wrote:

> It's strange to me that the Todo Lite example works for you but not other
> things. We have tracked it down to an issue with Android 4.x, which seems
> to be fixed in 4.4.2 (at least on my Nexus 7).
>
> Can you tell us more about your Android version?
>
> Here is the bug report (there are a few others if you search the tracker
> for "basic auth") https://code.google.com/p/android/issues/detail?id=10307
>
> I'm not sure what the workaround is yet -- maybe manually setting the
> Authorization header will do it. We are also trying some combinations of
> doing a GET before a PUT, etc, to see if we can box in the corner case.
>
> Chris
>
>
> On Sunday, May 18, 2014 4:53:11 AM UTC-7, Will Holcomb wrote:
>>
>> I was able to get the ToDo working. I tried using coax to access my db:
>>
>> cblite.getURL( function( err, url ) {
>>   var coax = require( 'coax' )
>>   var db = coax( [url, 'wells'] )
>>
>>   db.put( function( err, res ) {
>>     if( err ) {
>>       alert( "ip:" + err )
>>     }
>>     â‹®
>>
>> This prints: "ip:Syntax error: Unexpected end of input". Creating a
>> database like this is pretty much verbatim from the example; very
>> frustrating…
>>
>> -Will
>>
>> On Friday, May 16, 2014 10:57:37 PM UTC-4, J. Chris Anderson wrote:
>>>
>>> There is a similar discussion going on here: https://github.com/
>>> couchbaselabs/TodoLite-PhoneGap/issues/5
>>>
>>> Are you able to get the TodoLite example app to work? It works for me,
>>> but I'm not a very large sample set...
>>>
>>> Chris
>>>
>>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Couchbase Mobile" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/mobile-couchbase/PCVFGaiTL5I/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mobile-couchbase/38adc762-2607-45b6-a356-2ad980f319a0%40googlegroups.com<https://groups.google.com/d/msgid/mobile-couchbase/38adc762-2607-45b6-a356-2ad980f319a0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/CAB8ffCDnh0DjM2Vhn5e6oV1L7YkSMtxBDd8jmMTsmHw%3DSiN-ZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to