Code Monkey home page Code Monkey logo

pintura's People

Contributors

cricke avatar deanlandolt avatar dvv avatar feneric avatar kriszyp avatar neonstalwart avatar smith avatar

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  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  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

pintura's Issues

jsgi error module

When trying to throw an AccessError, I ran into a problem at

https://github.com/persvr/pintura/blob/master/jsgi/error.js#L24

Basically, e instanceof AccessError is always false. I'm wondering if it is because they don't come from the same physical file. I load require("perstore/errors").AccessErrors which pulls in ./node_modules/perstore/errors.js. However, pintura's jsgi module, which uses the same require, loads ./node_modules/pintura/node_modules/perstore/errors.js . This ends up causing the instanceof operator to fail.

For now I've worked around this issue by changing the check to be:
if (e instanceof AccessError || (e.name && e.name=="AccessError"))

Which seems to do the trick for me for now, but perhaps there is a better way to fix this issue?

customRoutes broken

jsgi/routes can take a customRoutes config array. i'm not sure what the elements of that array should look like but 2 obvious choices are:

  1. each element would be an array that becomes the arguments to declare
  2. each element is an object similar to the r variable used in declare.

however the way in which the elements are added won't work no matter what the elements are. also, if you provide null or undefined as the customRoutes then an error occurs because it's assumed to always be an array. i couldn't decide which way to fix this

  • should we just remove customRoutes?
  • should customRoutes be an array of r-like objects and then avoid calling declare and just push them onto routes?
  • should customRoutes be an array of arrays so that for each element we call declare.apply(null, customRoutes[ i ]);?

Session

  • what if I call Session.getCurrentSession() several times?! I get multiple sessions!
  • some store.put() return promises -- so we need to when() then all across the code -- I suggest to always create a session prior to handling nextApp in Session.js
  • session.save is missing
  • context.js L12: promiseModule.currentContext = null; nullifies the context, but promised actions in nextApp haven't completed yet -- thus I constantly get "null" calling Session.getCurrentSession().

--Vladimir

#44 was wrong

i just realized why the opening write('[') was outside the forEach... if the array has a length of 0 it will be wrong. i should have a fix for it tomorrow.

media

don't work:

text/csv

Error: TypeError: Cannot read property 'length' of undefined
at Object.forEach (jar:http://github.com/kriszyp/pintura/zipball/master!/lib/media/csv.js:18:29)
at handle (jar:http://github.com/kriszyp/jsgi-node/zipball/master!/lib/jsgi-node.js:139:33)
at notify (/home/dvv/IRC/nodules/lib/nodules-utils/promise.js:147:27)
at notifyAll (/home/dvv/IRC/nodules/lib/nodules-utils/promise.js:136:7)
at [object Object]. (/home/dvv/IRC/nodules/lib/nodules-utils/promise.js:176:5)
at jar:http://github.com/kriszyp/pintura/zipball/master!/lib/jsgi/cascade.js:19:28
at notify (/home/dvv/IRC/nodules/lib/nodules-utils/promise.js:147:27)
at notifyAll (/home/dvv/IRC/nodules/lib/nodules-utils/promise.js:136:7)
at [object Object]. (/home/dvv/IRC/nodules/lib/nodules-utils/promise.js:176:5)
at notify (/home/dvv/IRC/nodules/lib/nodules-utils/promise.js:152:29)

text/plain

Array.prototype.toString is not generic

-- Vladimir

static

Recent changes to jsgi/static broke static content handling completely.
The response is never returned.

Rotate Session

When the Session file gets too large, persvr will hang with a "RangeError: Maximum call stack size exceeded"

jsgi error module

When trying to throw an AccessError, I ran into a problem at

https://github.com/persvr/pintura/blob/master/jsgi/error.js#L24

Basically, e instanceof AccessError is always false. I'm wondering if it is because they don't come from the same physical file. I load require("perstore/errors").AccessErrors which pulls in ./node_modules/perstore/errors.js. However, pintura's jsgi module, which uses the same require, loads ./node_modules/pintura/node_modules/perstore/errors.js . This ends up causing the instanceof operator to fail.

For now I've worked around this issue by changing the check to be:
if (e instanceof AccessError || (e.name && e.name=="AccessError"))

Which seems to do the trick for me for now, but perhaps there is a better way to fix this issue?

Need "access-control-expose-headers : content-range" to make dgrid's Pagination work with JsonRest

I'm testing pintura and I started from persevere-example-wiki where I'm using the MySQL store to load a list of items into a dgrid (that uses Pagination extension and dojo/store/JsonRest as store).

The visible effect is that the dgrid shows "1 - 1 of 0" in the footer and when you try to navigate to next page it will get all the products.

The headers are returned correctly by pintura but the JsonRest refuses to use content-range and gives error that is an unsafe header.

To make it work I added the following code into pintura/jsgi/rest-store.js after line 122:

if (request.crossSite) { headers["access-control-expose-headers"] = "content-range"; }

I'm not sure this is the best place to solve it, maybe it can be added in xsite.js but that's why I submited this issue before makeing a PR.

publish to npm

many of the other packages that make up persevere (pintura) are published to npm. perstore and pintura seem to be the only exceptions.

Model writable?

I was wondering what a good standard approach would be to discovering if a model / item is writable. There are good reasons not to use OPTIONS for this (currently that just returns all available methods), and obviously one could implement a method, but a meta URI would probably best fit the HTTPWG approach.

Any ideas?

Problem running example in Rhino with SQL or Mongo

If I run the example wiki using rhino/narwhal by executing:

persvr example

it works fine. however, when i modify the page.js file to attempt to use either the SQL store or the Mongo store, i get errors.

SQL gives me this error:

TypeError: [JavaPackage org.persvr.store.SQLStore] is not a function, it is object

Mongo gives me this error:

Error: undefined failed to load file://...\example/lib/sys.js

All I have done is modify the page.js file by uncommenting the appropriate section to change the pageStore that is used...

I also get this error when I run the page through the browser:
"Error: You must assign a getDataModel method to the pintura config object in order to expose data"

Cross-domain requests

How can I POST data to datastore cross-domain? I have my webapp running on 127.0.0.1/app.html and Pintura is running on 127.0.0.1:8080. I can authenticate and get pintura-session cookie but I can't get POST to work. I have tried to put Client-Id with pintura-session string but no luck, I'm still getting 405 error.

callAsync is not defined

When I'm trying to query model with Dojo's Datastore, I get 'ReferenceError: callAsync is not defined'. I'm using MongoDB. Pure HTTP REST GET call works but for some reason it breaks with Dojo. Is this a bug or am I missing some dependency?

Break line is 319 in mongodb.js and it basically calls 'when(callAsync(collection.count, [search]), function(totalCount){'.I have promissed-io in the mappings so when() should work properly.

jsgi/rest-store.js: wrong content-range header value returned when store is empty

I discovered it while working with a dgrid that uses the Pagination extension, a JsonRest store and on server side a mysql-store on an empty table.

The returned header is:
content-range: items 0--1/*

The observed effect is that dgrid displays on footer "Nan - Nan of NaN results".

The code that creates the header is on lines 117 - 118 of persvr/pintura/jsgi/rest-store.js:

var end = start + (responseValue.length || 0) - 1;
headers["content-range"] = "items " + start + '-' + end + '/' + (count || '*');

At first I though is because on line 117, when start is 0 and responseValue.length is also 0 the result in end will be -1. Even though end should be 0 it didn't caused the dgrid problem.

The problem is the * returned as the count value on 118 line because in dojo/store/JsonRest.js at line 220

return range && (range = range.match(/\/(.*)/)) && +range[1];

it is returned +(the-count-value) and +('*') is Nan.

I tested with Chrome 36 and Firefox 30 and the dgrid & dojo are last code from master.

My quick solution was to replace (count || '*') with (count || '0') in the line 117 but I'm not sure how correct that is.

Virgil

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.