couchbase / couchbase-lite-net Goto Github PK
View Code? Open in Web Editor NEWA lightweight, document-oriented (NoSQL), syncable database engine for .NET
Home Page: http://developer.couchbase.com/mobile/
License: Apache License 2.0
A lightweight, document-oriented (NoSQL), syncable database engine for .NET
Home Page: http://developer.couchbase.com/mobile/
License: Apache License 2.0
Issue #5 provides an implementation plan, which is implemented in this issue.
View.SetMapReduce requires a non-null version parameter as the third attribute, but ApiTest.TestSharedMapBlocks passes null anyways. Should pass "1".
Should Replication.Changed Event Handler dispatched on the UI Thread especially for Android?
Since unconstrained generic types can be System.ValueType, comparisons to null are invalid in those cases. Need to either constrain to class
and add Nullable<T>
support, or check for default(Foo)
when !(Foo is ValueType)
.
I'm currently working on ApiTests, but there are lots of other test classes that need love.
Each one needs to be migrated eassentially from JUnit 3 to 4 in order to work with our current version of NUnit (attributes vs. Inheritance). Many of the NUmit methods also swap the ordering of the JUnit method params.
Then, cleanup the Java-like code to fit modern C# style. Verify the logic of the rest, then fix the library where tests fail.
Checks System.Diagnostics.Debug.Assert((minKey is string));
when minKey is usually an integer. Just a few lines later it calls ToJSONString(minKey)
anyways.
What is the work needed to expand our current support to include Xbox as well? May be trivial, but want to double-check to see if anything specialized is required.
How to reproduce :
Run ApiTest.TestAsyncViewQuery() or ApiTest.TestLiveQueryRun()
As Query.RunAsync() called its completion handler via Database.Manager.CapturedContext.Scheduler(), the completion handler gets blocked from processing. This happens because the CapturedContext and the unit test are running on the same thread.
The test itself has an issue, as the numPruned
should match 10
, the value in the Java unit test.
Also, Database.cs:4061
still has embedded ?
placeholders in the SQL fragment instead of the ADO.NET @
character.
Appears to be related to couchbase/couchbase-lite-java-core/issues/210
Implement Authenticator and AuthenticatorFactory API according to :
https://github.com/couchbaselabs/couchbase-lite-api/blob/master/gen/md/Replication.md
Non-deterministic behavior, but usually happens when running a large number of test sessions without resetting the local sync_gateway.
[0:] CouchbaseLiteiOSTests(32913,0xb0a13000) malloc: *** error for object 0x4c400800: non-page-aligned, non-allocated pointer being freed
*** set a breakpoint in malloc_error_break to debug
mono-rt: Stacktrace:
mono-rt: at <unknown> <0xffffffff>
mono-rt: at (wrapper managed-to-native) Mono.Data.Sqlite.UnsafeNativeMethods.sqlite3_prepare (intptr,intptr,int,intptr&,intptr&) <IL 0x0002a, 0xffffffff>
CouchbaseLiteiOSTests(32913,0xb0a13000) malloc: *** error for object 0xffff: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
mono-rt: at Mono.Data.Sqlite.SQLite3.Prepare (Mono.Data.Sqlite.SqliteConnection,string,Mono.Data.Sqlite.SqliteStatement,uint,string&) [0x00044] in /Developer/MonoTouch/Source/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3.cs:268
mono-rt: at Mono.Data.Sqlite.SqliteCommand.BuildNextCommand () [0x00019] in /Developer/MonoTouch/Source/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteCommand.cs:230
CouchbaseLiteiOSTests(32913,0xb0a13000) malloc: *** error for object 0x1: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
mono-rt: at Mono.Data.Sqlite.SqliteCommand.GetStatement (int) [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteCommand.cs:264
2014-05-20 20:24:34.271 CouchbaseLiteiOSTests[32913:9707] Batcher: scheduleWithDelay called with delay: 0 ms
mono-rt: at Mono.Data.Sqlite.SqliteDataReader.NextResult () [0x000cc] in /Developer/MonoTouch/Source/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteDataReader.cs:914
CouchbaseLiteiOSTests(32913,0xb0a13000) malloc: *** error for object 0x73006469: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
CouchbaseLiteiOSTests(32913,0xb080f000) malloc: *** error for object 0x18f3e224: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
CouchbaseLiteiOSTests(32913,0xb080f000) malloc: *** error for object 0x18f3e220: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
[0:] Batcher: scheduleWithDelay called with delay: 0 ms
mono-rt: at Mono.Data.Sqlite.SqliteDataReader..ctor (Mono.Data.Sqlite.SqliteCommand,System.Data.CommandBehavior) [0x00051] in /Developer/MonoTouch/Source/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteDataReader.cs:89
mono-rt: at Mono.Data.Sqlite.SqliteCommand.ExecuteReader (System.Data.CommandBehavior) [0x00006] in /Developer/MonoTouch/Source/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteCommand.cs:539
mono-rt: at Mono.Data.Sqlite.SqliteCommand.ExecuteNonQuery () [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteCommand.cs:568
mono-rt: at Couchbase.Lite.Storage.MonoSQLiteStorageEngine.InsertWithOnConflict (string,string,Couchbase.Lite.Storage.ContentValues,Couchbase.Lite.Storage.ConflictResolutionStrategy) [0x0004d] in /Users/zgramana/Source/couchbase-lite-net/src/Couchbase.Lite.Shared/Store/MonoSQLiteStorageEngine.cs:245
mono-rt: at Couchbase.Lite.Storage.MonoSQLiteStorageEngine.Insert (string,string,Couchbase.Lite.Storage.ContentValues) [0x00006] in /Users/zgramana/Source/couchbase-lite-net/src/Couchbase.Lite.Shared/Store/MonoSQLiteStorageEngine.cs:230
mono-rt: at Couchbase.Lite.Database.InsertDocumentID (string) [0x00024] in /Users/zgramana/Source/couchbase-lite-net/src/Couchbase.Lite.Shared/Database.cs:3740
[0:] mono-rt: at Couchbase.Lite.Database.GetOrInsertDocNumericID (string) [0x00014] in /Users/zgramana/Source/couchbase-lite-net/src/Couchbase.Lite.Shared/Database.cs:1211
mono-rt: at Couchbase.Lite.Database.ForceInsert (Couchbase.Lite.Internal.RevisionInternal,System.Collections.Generic.IList`1<string>,System.Uri) [0x00090] in /Users/zgramana/Source/couchbase-lite-net/src/Couchbase.Lite.Shared/Database.cs:1088
mono-rt: at Couchbase.Lite.Replicator.Puller.InsertRevisions (System.Collections.Generic.IList`1<System.Collections.Generic.IList`1<object>>) [0x000b8] in /Users/zgramana/Source/couchbase-lite-net/src/Couchbase.Lite.Shared/Replication/Puller.cs:459
mono-rt: at Couchbase.Lite.Support.Batcher`1.ProcessNow () [0x00212] in /Users/zgramana/Source/couchbase-lite-net/src/Couchbase.Lite.Shared/Replication/Batcher.cs:164
mono-rt: at Couchbase.Lite.Support.Batcher`1/<Batcher>c__AnonStorey0.<>m__0 () [0x00028] in /Users/zgramana/Source/couchbase-lite-net/src/Couchbase.Lite.Shared/Replication/Batcher.cs:96
mono-rt: at Couchbase.Lite.Support.Batcher`1.<ScheduleWithDelay>m__0 (System.Threading.Tasks.Task) [0x00023] in /Users/zgramana/Source/couchbase-lite-net/src/Couchbase.Lite.Shared/Replication/Batcher.cs:307
mono-rt: at System.Threading.Tasks.TaskActionInvoker/ActionTaskInvoke.Invoke (System.Threading.Tasks.Task,object,System.Threading.Tasks.Task) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading.Tasks/TaskActionInvoker.cs:113
mono-rt: at System.Threading.Tasks.Task.InnerInvoke () [0x00019] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading.Tasks/Task.cs:550
mono-rt: at System.Threading.Tasks.Task.ThreadStart () [0x000d0] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading.Tasks/Task.cs:438
mono-rt: at System.Threading.Tasks.Task.Execute () [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading.Tasks/Task.cs:514
mono-rt: at System.Threading.Tasks.TpScheduler.TaskExecuterCallback (object) [0x00007] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading.Tasks/TpScheduler.cs:59
mono-rt: at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <IL 0x00052, 0xffffffff>
mono-rt:
Native stacktrace:
mono-rt:
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Steps to reproduce :
Initial Debug :
To avoid potential deadlocks, replace lock(this)
with a private lock object instead:
private readonly Object locker = new Object();
...
lock(locker)
{
// Do foo
}
There are related chores for this, including developer account set up, etc. but a general task to get started is for an investigation into requirements.
Based on Android implementation, ChangeTracker should also support sending POST requests to Sync Gateway.
Implement Replication.SetCookie() and DeleteCookie() to support cookie management.
This mostly happens when trying to put new properties to a document several times fast.
StackTrace:
[SQLiteLog] (1) statement aborts at 2: [ROLLBACK] cannot rollback - no transaction is active
[mono-rt] Stacktrace:
[mono-rt]
[mono-rt] at <unknown> <0xffffffff>
[mono-rt] at (wrapper managed-to-native) Mono.Data.Sqlite.UnsafeNativeMethods.sqlite3_reset (intptr) <IL 0x00025, 0xffffffff>
[mono-rt] at Mono.Data.Sqlite.SQLite3.Reset (Mono.Data.Sqlite.SqliteStatement) <IL 0x0000b, 0x0004b>
[mono-rt] at Mono.Data.Sqlite.SqliteDataReader.NextResult () <IL 0x0002a, 0x0008b>
[mono-rt] at Mono.Data.Sqlite.SqliteDataReader.Close () <IL 0x0001e, 0x00087>
[mono-rt] at Couchbase.Lite.Cursor.Close () [0x00018] in /Users/pasin/Git/couchbase-lite-net/src/Couchbase.Lite.Shared/Store/Cursor.cs:127
[mono-rt] at Couchbase.Lite.Database.GetDocNumericID (string) [0x0006a] in /Users/pasin/Git/couchbase-lite-net/src/Couchbase.Lite.Shared/Database.cs:2190
[mono-rt] at Couchbase.Lite.Database.PutRevision (Couchbase.Lite.Internal.RevisionInternal,string,bool,Couchbase.Lite.Status) [0x00064] in /Users/pasin/Git/couchbase-lite-net/src/Couchbase.Lite.Shared/Database.cs:2941
[mono-rt] at Couchbase.Lite.Database.PutRevision (Couchbase.Lite.Internal.RevisionInternal,string,bool) [0x0000c] in /Users/pasin/Git/couchbase-lite-net/src/Couchbase.Lite.Shared/Database.cs:2905
[mono-rt] at Couchbase.Lite.Document.PutProperties (System.Collections.Generic.IDictionary`2<string, object>,string,bool) [0x0013b] in /Users/pasin/Git/couchbase-lite-net/src/Couchbase.Lite.Shared/Document.cs:432
[mono-rt] at Couchbase.Lite.Document.PutProperties (System.Collections.Generic.IDictionary`2<string, object>) [0x00016] in /Users/pasin/Git/couchbase-lite-net/src/Couchbase.Lite.Shared/Document.cs:302
[mono-rt] at SimpleAndroidSync.MainActivity/ListLiveQueryAdapter/<GetView>c__AnonStorey0.<>m__0 (object,System.EventArgs) [0x00055] in /Users/pasin/Git/couchbase-lite-net/samples/SimpleAndroidSync/MainActivity.cs:112
[mono-rt] at (wrapper delegate-invoke) <Module>.invoke_void__this___object_EventArgs (object,System.EventArgs) <IL 0x00027, 0x00042>
[mono-rt] at (wrapper delegate-invoke) <Module>.invoke_void__this___object_EventArgs (object,System.EventArgs) <IL 0x00027, 0x00042>
[mono-rt] at (wrapper delegate-invoke) <Module>.invoke_void__this___object_EventArgs (object,System.EventArgs) <IL 0x00027, 0x00042>
[mono-rt] at (wrapper delegate-invoke) <Module>.invoke_void__this___object_EventArgs (object,System.EventArgs) <IL 0x00059, 0xffffffff>
[mono-rt] at Android.Views.View/IOnClickListenerImplementor.OnClick (Android.Views.View) [0x0000d] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/5e0ae404/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Views.View.cs:1615
[mono-rt] at Android.Views.View/IOnClickListenerInvoker.n_OnClick_Landroid_view_View_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/5e0ae404/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Views.View.cs:1582
[mono-rt] at (wrapper dynamic-method) object.8c441b9e-ed72-4adf-a740-3fb1a47b1cb7 (intptr,intptr,intptr) <IL 0x00017, 0x0001f>
[mono-rt] at (wrapper native-to-managed) object.8c441b9e-ed72-4adf-a740-3fb1a47b1cb7 (intptr,intptr,intptr) <IL 0x00023, 0xffffffff>
After deleting checked items via the Clean button, the follow UIAlertView
is shown:
The number of rows contained in an existing section after the update (10) must
be equal to the number of rows contained in that section before the update (10),
plus or minus the number of rows inserted or deleted from that section
(0 inserted, 9 deleted) and plus or minus the number of rows moved into or out
of that section (0 moved in, 0 moved out).
CouchbaseTableSource.DeleteDocumentsAtIndexes
throws this because after it calls TableView.DeleteRows
the UIKit will call CouchbaseTableSource.RowsInSection
during its consistency check.
When TestGetReplication
runs by itself, or with the other tests in ReplicationTest
it always passes. However, when running all 87 tests it always fails. When it fails, it fails because it calls replication.Stop()
but replication.IsActive
returns true.
I would like to discuss the possibility of extending/converting the couchbase lite .net in order to support more platforms than xamarin.droid and xamarin.touch only. Currently the shared files depend on a number of namespaces, such as: System.Data, Mono.Data.Sqlite, System.Web, System.Threading, System.Security... which makes compiling these files with, for example, a windows 8(.1) (store) project impossible.
I think the proper architecture would be to define a PCL with the database functionality rewritten to use something like SQLite.Net-PCL/Async and HttpClient for networking.
Of course, this looks like quite some work, and it has the drawback that automated conversion from java would not be that easy anymore, if not impossible. I can invest some of my time in this, but will not do so if there is no support or interest from others... most notably couchbase.
The first consideration will be which profile to target.
Second, will need to consider how to manage the dependency on SQLite. We could move the MonoSqliteStorageEngine to a new Couchbase.Lite.Sqlite non-PCL assembly. However, we'd then need to provide a new default implementation in Couchbase.Lite. If we tried to source link community-sqlite-net, we'd not be able to target WP8 or WinRT (unless they've done a lot of refactoring since last June).
Options:
Perhaps someone with deeper WP8/WinRT-fu can weigh in.
View.SetMapBlock should accept String.Empty while rejecting null.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.