Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems with true/false objects #55

Closed
boxxxie opened this issue Jan 4, 2014 · 9 comments
Closed

problems with true/false objects #55

boxxxie opened this issue Jan 4, 2014 · 9 comments

Comments

@boxxxie
Copy link
Contributor

boxxxie commented Jan 4, 2014

here is some output from my chrome dev tools resources indexedDB menu

0
"spo::6654115829151124::api_key::aaaa"
"{"subject":"6654115829151124","predicate":"api_key","object":"aaaa"}"
1
"spo::6654115829151124::connected::"
"{"subject":"6654115829151124","predicate":"connected","object":false}"
2
"spo::6654115829151124::connected::false"
"{"subject":"6654115829151124","predicate":"connected","object":"false"}"
3
"spo::6654115829151124::connected::true"
"{"subject":"6654115829151124","predicate":"connected","object":true}"

there is a quirk near the top where the value of false is not being represented in the index key of "spo::6654115829151124::connected::"

@mcollina
Copy link
Collaborator

mcollina commented Jan 4, 2014

The issue is on the utilities/genKey function, where each value is checked
to be truthy. Instead, we should check if a value is not null or undefined.

That is the most used function in LevelGraph, and it has been heavily
optimized. I'll try to fix this soon without causing a perf regression.

Eventually, this will be released as 0.8.0, as current master has some new
optimizations!

@mcollina
Copy link
Collaborator

mcollina commented Jan 4, 2014

Can you please verify if this is causing any other problems apart from key discrepancies?

@mcollina
Copy link
Collaborator

mcollina commented Jan 4, 2014

This should be fixed in the latest master. Can you please give it a spin and in case reopen?

@boxxxie
Copy link
Contributor Author

boxxxie commented Jan 5, 2014

do i git clone from master or can i use npm? also do i have to build (i'm only using levelgraph with indexedDB right now).

@mcollina
Copy link
Collaborator

mcollina commented Jan 5, 2014

Clone, npm install and then run ./browserify.sh and grab the latest build.

Let me know if you have problems, I can upload one for you.

@boxxxie
Copy link
Contributor Author

boxxxie commented Jan 5, 2014

seems to be working. thanks a lot.

@boxxxie
Copy link
Contributor Author

boxxxie commented Jan 5, 2014

actually, i spoke too soon. it seems that with the current build the object part still doesn't get indexed correctly (left blank for false values).

so, this is still an open issue.

however my program is now working properly (it isn't relying on the index for the object).

@mcollina
Copy link
Collaborator

mcollina commented Jan 5, 2014

Have you verified with a clean database? It does not fix previous values,
but it works properly here (I added a unit test). In case it is not fixed
yet, can you please provide some code to reproduce?

@mcollina
Copy link
Collaborator

mcollina commented Jan 6, 2014

Released as v0.8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants