Code Monkey home page Code Monkey logo

keen-sdk-net's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

keen-sdk-net's Issues

bulk adding events failing with no error message

Example:

Message: [KeenException: AddEvents failed with status: StatusCode: 404, ReasonPhrase: 'Not Found', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:

{

Server: nginx

Date: Fri, 29 Jan 2016 17:06:13 GMT

Connection: close

Content-Length: 162

Content-Type: text/html

}]

Assembly does not have a strong name

Hi there, I'm getting the following issue when integrating the Keen client in my project:

Assembly generation failed -- Referenced assembly 'Keen' does not have a strong name

When you compile an assembly with a strong name, any referenced assemblies must also have strong names.

From http://support.microsoft.com/kb/313666.

This occurs on build after including the 0.3.1 KeenClient via NuGet.

Might be a wontfix but figured it's worth mentioning.

Here's a informative post on the issue http://www.codingblocks.net/programming/strongly-named-assemblies-in-nuget/.

AddEvent() on Xamarin iOS causes 100% NotImplementedException

While using KeenClient.AddEvent() on Xamarin iOS it throws a NotImplementedException 100%.

The exception is thrown from KeenUtil.CheckAPIErrorCode() (exception details below). I notice that just above this function in GetBulkAPIError() it is accessing the error details in a different way - AddEvents() does not cause the exception. Looking at the code I suspect that it is Xamarins lack of JIT support which is causing the issue.

Note that the cached event system (Keen.Core.EventCachePortable) is causing a very similar issue (2nd exception below), also 100%.

System.NotImplementedException: Interpreter of ref types
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileMethodCallExpression (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileConditionalExpression (System.Linq.Expressions.Expression expr, Boolean asVoid) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr, Boolean asVoid) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression (System.Linq.Expressions.Expression expr, Boolean asVoid) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileGotoExpression (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr, Boolean asVoid) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileConditionalExpression (System.Linq.Expressions.Expression expr, Boolean asVoid) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart (System.Linq.Expressions.BlockExpression node) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression (System.Linq.Expressions.Expression expr, Boolean asVoid) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileTop (System.Linq.Expressions.LambdaExpression node) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Generation.CompilerHelpers.LightCompile (System.Linq.Expressions.LambdaExpression lambda) [0x00000] in <filename unknown>:0 
      at System.Linq.Expressions.Compiler.LambdaCompiler.Compile (System.Linq.Expressions.LambdaExpression lambda, System.Runtime.CompilerServices.DebugInfoGenerator debugInfoGenerator) [0x00000] in <filename unknown>:0 
      at System.Linq.Expressions.Expression`1[TDelegate].Compile () [0x00000] in <filename unknown>:0 
      at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T] (System.Runtime.CompilerServices.CallSite`1 site, System.Object[] args) [0x00000] in <filename unknown>:0 
      at System.Dynamic.UpdateDelegates.UpdateAndExecute1[Object,Object] (System.Runtime.CompilerServices.CallSite site, System.Object arg0) [0x00000] in <filename unknown>:0 
      at Keen.Core.KeenUtil.CheckApiErrorCode (System.Object apiResponse) [0x00000] in <filename unknown>:0 
      at Keen.Core.EventCollection+<AddEvent>d__10.MoveNext () [0x00000] in <filename unknown>:0 
System.NotImplementedException: Interpreter of ref types
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileMethodCallExpression (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileConditionalExpression (System.Linq.Expressions.Expression expr, Boolean asVoid) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr, Boolean asVoid) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression (System.Linq.Expressions.Expression expr, Boolean asVoid) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileGotoExpression (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr, Boolean asVoid) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileConditionalExpression (System.Linq.Expressions.Expression expr, Boolean asVoid) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart (System.Linq.Expressions.BlockExpression node) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression (System.Linq.Expressions.Expression expr, Boolean asVoid) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Interpreter.LightCompiler.CompileTop (System.Linq.Expressions.LambdaExpression node) [0x00000] in <filename unknown>:0 
      at Microsoft.Scripting.Generation.CompilerHelpers.LightCompile (System.Linq.Expressions.LambdaExpression lambda) [0x00000] in <filename unknown>:0 
      at System.Linq.Expressions.Compiler.LambdaCompiler.Compile (System.Linq.Expressions.LambdaExpression lambda, System.Runtime.CompilerServices.DebugInfoGenerator debugInfoGenerator) [0x00000] in <filename unknown>:0 
      at System.Linq.Expressions.Expression`1[TDelegate].Compile () [0x00000] in <filename unknown>:0 
      at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T] (System.Runtime.CompilerServices.CallSite`1 site, System.Object[] args) [0x00000] in <filename unknown>:0 
      at System.Dynamic.UpdateDelegates.UpdateAndExecute1[Object,Object] (System.Runtime.CompilerServices.CallSite site, System.Object arg0) [0x00000] in <filename unknown>:0 
      at Keen.Core.EventCachePortable+<TryTake>d__1f.MoveNext () [0x00000] in <filename unknown>:0 

GetSchemas() throws an exception

When using the Keen Client to get the schemas in a project the following exception is thrown

Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray. Path '', line 1, position 1

Now this appears to be coming from the code in the Event.cs file.

A quick look at the code (plus a google) showed that you are using the wrong Newtonsoft.Json.Linq object. As the response returned from the API is an array not an object you should use JArray.Parse() and not JObject.Parse() on line 35.

EncryptString Produces Invalid Scoped Key

We previously relied on EncryptString but discovered that the changes in dc77ea8 produced an invalid key: {"message": "Specified API Key is invalid. API Key: '....', "error_code": "InvalidApiKeyError"}

The same string value passed as an object to Encrypt appears to work.

Keen.Core.ScopedKey.Encrypt(key, Newtonsoft.Json.Linq.JObject.Parse(json)) and Keen.Core.ScopedKey.EncryptString(key, json) should match but only the former is producing a valid key at the moment.

Port streaming/event upload functionality

This work item encompasses bring over code that allows SDK clients to stream events to Keen IO. The goal here is parity with the existing legacy PCL, though possibly without EventCachePortable, which merits its own issue. The bulk of this should be simply copying code over to the new netstandard project and getting it to build. All tests associated with the ported features should be ported as well.

Potential bug in EventCachePortable

On line 57 of EventCachePortable.cs when initialising the Event Cache from the list of files on disk, the Event Cache is only populating the events queue if the events queue already has an item in it - if(events.Any()). This seems like the wrong way around and looks like it means the EventCachePortable will never load items off disk which were saved from a previous session.

Apologies if I have misunderstood this code but it looks like a bug to me.

Will

Scoped Keys Are Malformed, resulting in "401 Unauthorized"

Encrypted keys generated by the .NET library are invalid.
When used for querying they produce a "401 Unauthorized".
When tested using the Keen Decrypter, the keys return valid, and sometimes invalid results depending on IV.

A scoped key generated using 32 byte IV, when decrypted, looks something like:

���t=��pR����������D��ki�� �Z��T���˄�yN"T-�t َJɦ�5����փ���FG��gIQ�� }�:�I�m��F׵W�!VR��g�=O�f���f�xJ�,!�Ǎ���l{����E�� ��?:��vХB3f���\5���y�G?����z������n�b�Q,�@�t�Ip.�& ��z骯W�o���"�_EZw� ��

A scoped key generated using an empty string for IV, when decrypted:

{ 'filters': [{ 'property_name': 'v_id', 'operator': 'eq', 'property_value': 'a-valid-value' }], 'allowed_operations': [ 'read' ] }

Neither key works for querying; both return "401".

Groove ticket with customer example:
https://keen-io.groovehq.com/groove_client/mailboxes/4308/filters/51671/tickets/2300068

Ensure CNAME redirect and Custom SSL Domains work

There exists a mechanism for setting the base authority for the Keen API, but we should make sure it applies for all functionality and is properly isolated between KeenClient instances. It should work with HTTP proxying, too, of course.

Add HTTP Proxy support

Allow plugging in DelegatingHandler and HttpClientHandler instances that override default behavior such as implementing proxy support. Perhaps make it simpler by toggling proxy support at a higher abstraction if it makes sense.

AddEventAsync fire and forget?

Hi Keen Team,

I use the keen .NET SDK and have just noticed a few errors popped up the other day in my .NET WEB API application. The error points back to the keenClient.AddEvent() function not completing, timing out or failing to connect.

I don’t mind if these events don’t make it to keen, I would prefer the API transaction to succeed and not get the stats, rather than have the process fall over because the API couldn't contact Keen. I just want to implement a "fire and forget" pattern.

So my question is:
Does the asynchronous version of AddEvent (I.e. KeenClient.AddEventAsync()) still cause exceptions if it cannot connect? Or should I just wrap the keenClient.AddEvent() call in a try/catch block and ignore the exception?

Xamarin Forms - System.BadImageFormatException was thrown: Could not resolve field token 0x04000219

Although I am now having another problem when trying to add an event:

            var prjSettings = new ProjectSettingsProvider("~REMOVED~", writeKey: "~REMOVED~");
            var keenClient = new KeenClient(prjSettings);
            keenClient.AddGlobalProperty("clienttype", "mobile");

                        // Build an event object
            var aPurchase = new
            {
                category = "magical animals",
                username = "hagrid",
                price = 7.13,
                payment_type = "information",
                animal_type = "norwegian ridgeback dragon",
                user_ip = "8.8.8.8",
                ua = "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt; .NET CLR 1.0.3705)"
            };

            // send the event
            keenClient.AddEvent("purchases", aPurchase);

the AddEvent call asserts with:

System.BadImageFormatException was thrown: Could not resolve field token 0x04000219

Seems like update broke the namespaces

I just updated the Keen.IO .NET SDK on Nuget and seems like it's broken.

This is the code sample that used to work :

var projectSettings = new ProjectSettingsProvider (keenIOProjectID, keenIOMasterKey,     keenIOWriteKey, keenIOReadKey);

var keenClient      = new KeenClient (projectSettings);

The namespaces changed, and now I can only find the "KeenClient" one, which is on the : ifunction.KeenSDK.Core namespace, which is a bit weird. I can't seem to find the following class, though : ProjectSettingsProvider.

Also, the "JSON.NET" is missing as a dependency to the Keen.IO Nuget Package, so once we pull the .dll from Nuget, it doesn't bring the JSON.NET .dll aswell. Without the dependency the Keen.IO gets downloaded, but crashes on every call because it's missing JSON.NET dll dependency.

ScopedKey.Encrypt System.Convert.ToChar

Try to create scropedkey throw exception Message=Value was either too large or too small for a character in function ScopedKey.AddPadding(String text).
` dynamic secOps = new ExpandoObject();

        IDictionary<string, object> filter = new ExpandoObject();
        filter.Add("property_name", "account_id");
        filter.Add("operator", "eq");
        filter.Add("property_value", 123);
        secOps.filters = new List<object>() { filter };
        secOps.allowed_operations = new List<string>() { "read" };

        var scopedKey = ScopedKey.Encrypt(_keenioMasterKey, (object)secOps);`

Keen IO bulk add operation suddenly stops working

This issue was posted on Stack Overflow where it is awaiting a more specific answer. Please answer the question there and then close this issue.

I’m starting to get this error message:

“One or more events was rejected during the bulk add operation” since July 3rd, every time I run my batch job to upload files from S3 to Keen using the .net SDK.

I'm not sure if this error is coming from Keen IO's server or somewhere else.
Do you have any idea why I’m getting this message?```

.NET 3.5 version of SDK duplicates code from portable library and .NET 4.0 library.

The .NET 3.5 project contains what is mostly copy and pasted code from the more recent library (or vice-versa). The project should be refactored so as to not duplicate any code. CLR features not supported by 3.5 should be either removed from the new library, implemented as a component that can vary between the SDK versions, or implemented as a shim or derived class in the .NET 4/4.5/portable library.

Windows Phone 8.1 client. KeenClient.AddEventAsync crashes app in airplane mode.

Hi there.
When i set phone to the airplane mode keenClient crashes application with unhandled exception.
Call stack if it helps:
"System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.
at unknown location

Aggregated Exception [0]: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot perform runtime binding on a null reference
at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
at Microsoft.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
at Keen.Core.KeenClient.d__18.MoveNext()"

Create initial, minimal csproj targeting netstandard2.0

This should be a new project that targets netstandard2.0. This will be built out as the new netstandard2.0 compliant project. We'll bring (copy) features into it one at a time from the existing codebase, so this should be located in a sibling directory among the existing SDK projects. This should build on any platform that supports netstandard2.0. A new test project should also be created for this library targeting netstandard2.0.

.NET 3.5 version of SDK fails during runtime

The nuget KeenClient package installed for a project that targets .NET 3.5 will fail at runtime when trying to load Netwonsoft.Json.dll.

Repo steps:

  1. Open Visual Studio 2015 Community Edition Update 3
  2. Create a new C# console application (File->New->Project..., select .NET Framework 3.5, Visual C#->Console Application)
  3. Open nuget package manager console and run PM> Install-Package KeenClient
  4. Paste the following code into Program.cs and add a valid project and write key:
using Keen.NET_35;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace keen_35_test_console
{
    class Program
    {
        static void Main(string[] args)
        {
            var projectId = "<insert project id here>";
            var writeKey = "<insert write key here>";

            var project = new ProjectSettingsProvider(
                projectId,
                writeKey: writeKey
                );

            var client = new KeenClient(project);

            var collection = "test_collection";
            client.AddEvent(collection, new { string_key = "3.5", numeric_key = 7.123 });
        }
    }
}
  1. Run the program

Expected:
6. Event is added to the "test_collection" collection.

Actual:
6. Program crashes with a System.IO.FileLoadException.

Exception details:
An unhandled exception of type 'System.IO.FileLoadException' occurred in keen_35_test_console.exe

Additional information: Could not load file or assembly 'Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Perhaps this is because there are version conflicts in the version of Newtonsoft.Json being referenced. The root KeenClient.nuspec references version 6.0.3 of Newtonsoft.json, while Keen.NET_35.csproj references ..\packages\Netwonsoft.Json.8.0.3\lib\net35\Netwonsoft.Json.dll. Keen.NET_35/packages.config also references version 8.0.3 of the library. If I manually install version 8.0.3 instead of version 6.0.3, the program runs as expected. So the solution seems to be reference version 8.0.3 in KeenClient.nuspec for target "net35".

Automated Unit Tests Have Poor Coverage

Unit tests don't actually exercise core components of the SDK. The EventCollection and Event classes are basically untested by automated testing.

A solution would be to do away with the UseMocks flag found in the tests, and use a mock HTTP protocol handler that would validate requests and provide canned responses.

Keen.IO on .NET 3.5 framework (Unity3D)

Hello,

I'm looking into integrating Keen.IO in a PC/OSX/WebPlayer Unity3D app. I grabbed your SDK but it's written in .NET 4.0, while my Unity3D 3.5 environment is stuck in what seems to be .NET 3.5-ish, maybe older.

I'm thinking of rewriting the code and attempt to downgrade frameworks, yet being unfamiliar with new C# and .NET features the task seems daunting to me.

Any advice, suggestion on how to go about it?
What about the SDK's dependencies, could they be downgraded too?

Investigate sending parameters as json encoded body vs. query string in SDK

It seems odd that, for example, the event recording portion of the SDK submits events using json, but the analysis requests pack the request parameters into a url-encoded parameter list as part of the request url. Really it makes sense that requests could be done either way, but mixing both ways in the SDK seems unnecessary and probably just adds code and complexity to the SDK.

This usage might have an impact on caching which would be good to consider.

Keen IO API documentation seems to suggest an application/json request body should be used for analyses and doing requests in this way might simplify how requests are done in general across the SDK.

Code such as Queries.KeenWebApiRequest and the methods on Queries that use it could be simplified to make use of Newtonsoft.Json to build the json request body. Going further, code that builds a request across the SDK could be consolidated. There are currently 6 places in the SDK that each create an instance of HttpClient, set authorization headers, make a request, and get the result. I bet there's an opportunity there to get rid of code by creating a common code path. Additionally, guidance for usage of HttpClient is to reuse instances.

Remove padding from scoped keys

Scoped keys should no longer be padded.

Also, we should handle the case where the passed in IV is an empty string and throw an exception in that instance.

Example of a key that encodes with padding:

Key Body:

{
  "filters": [{
    "property_name": "ParsedUrl.domain",
    "operator": "in",
    "property_value": ["www.leons.ca","www.leons.com"]
  }],
  "allowed_operations": ["read"]
}

Currently, this ends up generating the following key:

8795B1E827396614F19CD3EE40700C15EE30DD039CE80E30F18CFF1A9F2CEA73232784CAE725C32E84EB184E84919C97C4A1BED5F22CFE6FBBE575E913EBF349E3793B60B032135A2BC6CA13D8DCD3FC695831F751243FC9256F632E4B8F1377C99624D98A59C67964EC798C04B6E2557AF811EBC984AD826FEFEEAA4B89C050C1CA82A541D8B3EA52B97BE05C7623FCB13F891F57E1029ACD2B186F2F877C0149FABF2C560E55C1227C66EB3910E8043368BC02E4BC8FA5E049FD7A24C74FCE031AC4CE88453CB299F26FE0E5C1E5A8AFD5D5F000ACBDC7F422B6A767F68A493CA38F0228AB322CC28D756261DA4E9D7D05C03197FB6A3BC316DC984F7F24C72357F0E9B0B8CFE3BD16D2A6E1EC1593

Which decrypts to (including special chars):

{\r\n "filters": [\r\n {\r\n "property_name": "ParsedUrl.domain",\r\n "operator": "in",\r\n "property_value": [\r\n "www.leons.ca",\r\n "www.leons.com"\r\n ]\r\n }\r\n ],\r\n "allowed_operations": [\r\n "read"\r\n ]\r\n}\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11

The \x11 chars are the padding, which breaks when using the key to run queries against Keen.

The generated key for the same key body should be:

f925bbfcc0afcd641f2808ca83ad474d5854efb6b5a6743cc0ebe9b3b070c0eaf1dee30a40c999bc6fae9fc07609e960f3d3ab7e38471e479144f54306cd746109cd6b382b347072f6d733098685e7669777d9fe63c201bc7a1e71577a1543485bacf3652374fcaf30fc075796b8877ece6a8dc3eedbdfc5820722f6183809c56d62b745984b4ccf0e5b17a17646ea67883c3220ef0ca3f7545caa1fd40544932080f04ce5a1a07fa330f4da5db197b7

QueryFilter.FilterOperator.Equals() with null value

Hi,

I want to check if a property is null.

I'll do this with the following code

new QueryFilter("propertyname", QueryFilter.FilterOperator.Equals(), null)

But it throws an ArgumentNullException

Should I build my filter different? Or is my code correct and shouldn't the library throwing the ArgumentNullException?

Thanks for your answer!

Regards,
Dieter

cannot group by multiple fields

Hi,

As the groupValue argument is a string, I don't seem to be able to group by multiple fields (which Keen does support). Am I overlooking something, or is this indeed missing from the implementation?

Regards,
Bart

Support Saved/Cached Queries

MVP

  • Create Saved Query
  • Cache a Saved Query
  • Uncache a Saved Query
  • Delete a Saved Query
  • Retrieve Results from Saved Query

Stretch

  • Retrieve definition of a saved query
  • Update a cached query

Port simple/metric analyses to netstandard binary

This encompasses the work to perform single-analysis queries like count, minimum, sum, average, etc. This will involve porting a portion of Queries.cs, namely the Queries.Metric() overloads and related code, as well as the relevant parts of KeenClient that forward down to this implementation.

See the API Ref for more information:
https://keen.io/docs/api/#analyses

Queries/Event/EventCollection Refactor

It'd be preferable to shape the API around what the client code wants to do, rather than how the back-end API is shaped. These interfaces are super rigid and don't share much code. We need to really rethink the general design with maintenance in mind to be able to add features like Saved/Cached Queries, Datasets, Access Keys, etc.

Port/rewrite EventCachePortable for new netstandard PCL

This class is broken, and references API's that don't seem to be included in the netstandard API surface. First, confirm that the API's it relies on aren't included in netstandard2.0. If that's the case, it needs to be re-written targeting a netstandard API surface, along with robust unit tests. Otherwise, fix it and provide some good unit tests.

See #21

Funnel queries drop timeframes on FunnelSteps

Most places where we use timeframe parameters, (which are now required, and so should no longer be optional in the SDK interface going forward) we handle JSON-ifying the timeframe by doing something like this:

parms.Add(KeenConstants.QueryParmTimeframe, timeframe.ToSafeString());

However, when we take an IEnumberable<FunnelStep> and try to serialize it, we do this:

var jObs = steps.Select(i => JObject.FromObject(i));

...which results in the FunnelStep.Timeframe property being written as {}.

We should either customize JSON formatting for the Timeframe property, or for all QueryTimeframe instances across the board, and therefore not need to call ToString() everywhere we encounter one, or at least here in Queries.Funnel() manually write the JSON for each FunnelStep.

Continuous integration

Get some or all tests unit tests running. Eventually if we also have end-to-end or integration tests that aren't appropriate for CI, we'll want to make sure those aren't included here.

Step 1 is going to be choosing a CI provider. Other Keen SDKs tend to use Travis-CI so we could look there first and create an account with all the correct permissions in place and such.

Step 2 is put in place whatever .csproj/.sln and/or Travis-specific config files (like .travis.yml) are necessary.

Then we need to address related issues around expanding/improving tests and getting code coverage numbers being recorded.

Lastly we'll want this stuff reported via widgets in the readme.

Too many values for a filter value result in a `UriFormatException`

When setting values for a property in a query filter, that eventually take up > 32766 bytes length when they are fed into Uri.EscapeDataString (say new QueryFilter("prop", QueryFilter.FilterOperator.In(), guids) where guids is an array of 1000 guids), and executing keenClient.QueryAsync() (for example) against it, a UriFormatException is returned, thrown by this line.

The .NET SDK for Keen IO library should explicitly return a message about the length; ideally emitting the "rendered" length generated by Uri.EscapeDataString and notifying that the maximum generated length cannot exceed 32766 characters.

An even better solution is to alter the library to use POST requests and put these values in the requests' body (given that Keen API supports this request type and doesn't impose other server-side restrictions on the number of values in an in query filter)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.