Code Monkey home page Code Monkey logo

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

asteroid's Issues

Installing app on Android error (Ionic Framework)?

(Sorry if i don't mark this as a question, i'm new here)
By the way, i find that Asteroid is amazing! Good job!
So, i am currently developing a Ionic Framework App (Android), to communicate with a Meteor App (with it's own server), and i managed to succeed when testing in the browser (Google Chrome), but when i installed the app on a real Android device, it gave me an error...

WebSocket connection to 'ws://my.meteor.app.server' failed: Error during WebSocket handshake: Status line does not end with CRLF

It shows me that the error is on ddp.js, line 62. I have tried some things, like adding '\r' to the end of some variables, but i don't quite understand this WebSocket thing... Is there anyway someone can help me?

Chrome Extension + Twitter Login. Try to login everytime I ophen Chrome

Hi!

I've created a Chrome Extension, basically a background page that listens to a browser action (pressing on the extension icon). When that happens it send information about the page to the Meteor Backend.

The problem relies in the fact that everytime I open Chrome the background page logs in with twitter and opens a new tab in the browser.

Is there a way to do the login process in the backround? Or maybe store the credentials?

Am I explaining myself properly?

Thanks!

Refactor calls

Refactor Calls : Can we write the code for calls/loginWith etc to be similar to meteor .. which takes a callback .. rather than returning the promise. Its same .. but keeping api similar makes life simpler

fetch reactiveQuery with sorted data

I want to fetch data from collection with sort
var prod=Production.reactiveQuery({sort: {index : -1},productionId:$cookies.productionid});
sort is not working here

Subscribing with arguments seems to be broken

Hi @pscanf you know that classic pattern for implementing search, where you resubscribe to the same publication with a different query on keyup?

I've got this implemented with Asteroid and it's not working.

It seems like anytime I pass arguments into subscribe, nothing ever comes out, even though my publication is fine (verified from Meteor's own client).

Have you tried using subscribe with a query and had it working?

Asteroid on CDNs

Asteroid files, unminified, amount to ~98k right now (32KB for asteroid.browser.js, 58KB for q.js, and 8.5KB for ddp.js). It would help with page load speed to have them concatenated and minified on CDNjs and jsDelivr.

Some problem while assigning collections

    Ceres.subscribe("product-latest-10");
    var Products = Ceres.createCollection("products");

and

Products.find({});

However the Products here is undefined. I couldn't find what exactly the problem. Subscription is fine and return all messages correctly. Seems likes the TODO's asteroid code is different than the current code on github as I have to change the initialization to:

Ceres = new Asteroid('localhost:3000', false, true);

Login UI?

Has anyone built a login UI that uses Asteroid under the hood to login with user/pass, Facebook, Google, Twitter and GitHub?

Seems like an important part of the work is already done in @splendido's useraccounts, or @Differential's accounts-entry.

Support for Observe API

Hi !
The whole stuff is a really nice package and a great work. I'm already enjoying it using it.
What do you think about implementing 'observe' -> http://docs.meteor.com/#observe

The meteor-ddp package support it : https://github.com/eddflrs/meteor-ddp.

The implementation looks pretty straightforward :

https://github.com/eddflrs/meteor-ddp/blob/master/meteor-ddp.js#L153
and
https://github.com/eddflrs/meteor-ddp/blob/master/meteor-ddp.js#L212

So what do you think about it ?

Running serverside methods

Is this possible - if not (when) will it be?

Can't see any mentions of this in the source code or documentations...

How to do async fetch

I'm trying to do server-side rendering (in node.js), using Asteroid as the data layer.

Is there anyway to do an async data fetch and run a callback when there's data available?

Late Edit: I've already tried the ready promise on subscriptions, but it never seems to get executed. I can't even get a simple script to log results and exit.

LoginWith * Redirects do not work (Chrom Extension)

For some reason I can't make Facebook or Twitter Login to work on my chrome extension

        this.ddp = new Asteroid("localhost:3000");


        this.ddp.on('connected', =>
            console.log 'Connected'


            this.ddp.resumeLoginPromise.then( ->
                console.log ('ok')
            ).fail( =>
                console.log 'fail, now log in'

                this.ddp.subscribe("meteor.loginServiceConfiguration").ready.then =>
                    #this.ddp.loginWithTwitter()
                    this.ddp.loginWithFacebook()
            )
        )

This sends me to an endlessly loading new tab.

The following images are the callback urls for the facebook and twitter apps.
screen shot 2015-02-09 at 11 00 05 am
screen shot 2015-02-09 at 11 00 10 am

Any idea on why is this happening?

Thanks.

Not all login service have the same structure in DB.

Here is the piece of code that got me a bit trouble implementing Facebook / Google oauth login with Asteroid. The problem is that not all service use the same structure in the database as of the latest meteor. service.clientId should be change to some if else.

Asteroid.prototype._getOauthClientId = function (serviceName) {
    var loginConfigCollectionName = "meteor_accounts_loginServiceConfiguration";
    var loginConfigCollection = this.collections[loginConfigCollectionName];
    var service = loginConfigCollection.reactiveQuery({service: serviceName}).result[0];
    return service.clientId;
};

Here is the structure:

{
        "service" : "facebook",
        "appId" : "xxx",
        "secret" : "xxx",
        "_id" : "xxx"
}
{
        "service" : "twitter",
        "consumerKey" : "xxx",
        "secret" : "xxx",
        "_id" : "xxx"
}
{
        "service" : "google",
        "clientId" : "xxx",
        "secret" : ""xxx,
        "_id" : "xxx"
}

behavior of reactiveQuery and collections in example

// Connect to a Meteor backend
var ceres = new Asteroid("localhost:3000");

// Use real-time collections
ceres.subscribe("tasksPublication");
var tasks = ceres.getCollection("tasks");

tasks already contains values in tasks._set._items internal object

tasks.insert({
  description: "Do the laundry"
});
// Get the task
var laundryTaskRQ = tasks.reactiveQuery({description: "Do the laundry"});
// Log the array of results
console.log(laundryTaskRQ.result);

laundryTaskRQ.result in this (pseudo-synchronous) case is always empty array

// Listen for changes
laundryTaskRQ.on("change", function () {
  console.log(laundryTaskRQ.result);

In this case, result contain actual values.

});

My questions:

  1. Does reactiveQuery have synchronous behavior in this example? Or your example incorrect?
  2. if (1) is true, does Collection have API methods to get actual values in already existed ._set._items ?

error using loginWithGoogle

Using Chrome.

var ddp = new Asteroid("localhost:3000");

ddp.on('connected', function() {
  console.log("connceted");
  ddp.loginWithGoogle();
});

I get this error:

Uncaught TypeError: Cannot read property 'reactiveQuery' of undefined

From this method:

Asteroid.prototype._getOauthClientId = function (serviceName) {
    var loginConfigCollectionName = "meteor_accounts_loginServiceConfiguration";
    var loginConfigCollection = this.collections[loginConfigCollectionName];
    var service = loginConfigCollection.reactiveQuery({service: serviceName}).result[0];
    return service.clientId || service.consumerKey || service.appId;
};

Perform Two Phase Commits In Asteroid

rollback functionality via asteroid

in mongo we can do like this
db.transactions.insert( {
_id: 1, source: "A", destination: "B", value: 100, state: "initial", lastModified: new Date()
})

how do i perform same in asteroid upon insert,update, or remove?

LoginWithFacebook Error

When i try login with facebook it gives me, "Uncaught TypeError: Cannot read property 'reactiveQuery' of undefined "

Persistent login with DDP

Hi !

How one would handle persistent login with this nice asteroid lib ? I mean, if I want user to be able to close the browser and come back how could I do that without (i know its bad) saving the password and email locally. Woops my finger on fire.

Thanks a lot for any helpful advices

A complete example.

There must an overall example on how to use asteroid. With issues which might arise?
Any one?

Status indicator on subscription download

Is there any way to get feedback on whether or not a subscription is still loading documents? I'm using this on a mobile application and would love to display a loading icon while records are still loading. Great work, by the way!

loginWithGoogle redirect_uri_mismatch

I'm getting this error from Meteor on the server side

W20141127-09:50:17.280(-8) (oauth_server.js:398) Error in OAuth Server: Failed to complete OAuth handshake with Google. failed [400] {   "error" : "redirect_uri_mismatch" }

I checked the login url that is being generated by Asteroid:

https://accounts.google.com/AccountChooser?service=lso&continue=https%3A%2F%2Faccounts.google.com%2Fo%2Foauth2%2Fauth%3Fscope%3Dopenid%2Bemail%26response_type%3Dcode%26redirect_uri%3Dhttp%3A%2F%2Flocalhost%3A3000%2F_oauth%2Fgoogle%26state%3DeyJsb2dpblN0eWxlIjoicG9wdXAiLCJjcmVkZW50aWFsVG9rZW4iOiJlODk0N2M1MzVkYTZjMzg4NGUzM2MxYjVjZjQ5M2NhOCIsImlzQ29yZG92YSI6ZmFsc2V9%26client_id%3D60750537449-d2469pvur5lkfh4fs6cgo7q0100hk60g.apps.googleusercontent.com%26hl%3Den%26from_login%3D1%26as%3D-775f8062e42146ac&btmpl=authsub&hl=en

Compared to what is being generated by Meteor

https://accounts.google.com/AccountChooser?service=lso&continue=https%3A%2F%2Faccounts.google.com%2Fo%2Foauth2%2Fauth%3Fzt%3DChRQNW1LRng5NktlMFg0eHNhVUFQdRIfY3NvMDJ2NG1oOWtib2lJQmVPNlAybV9DR2JMa2t3SQ%25E2%2588%2599APsBz4gAAAAAVHdlnpuxD-W9_tPpKB5z3StCb_h4pCLI%26from_login%3D1%26hl%3Den%26as%3D-59273d9af2e8a0a5&btmpl=authsub&hl=en

I checked and the redirect_uri that is in the loginUrl generated by Asteroid is in my Google API configuration. (http://localhost:3000/_oauth/google)

Offline storage

First of all: Thank you so much for developing this project. I've read your blog post and I always felt exactly the same, not wanting to go for an all-in for Meteor, but rather use just the server part with a DDP connection to a client.

One thing I'd really like to use is offline storage, like they do in the Meteor world with Ground DB. Would something like this be possible with Asteroid?

loginWith token

I think some updates to how Meteor handles oauth might have messed things up for asteroid's Chrome platform loginWith methods. Asteroid.prototype._openOauthPopup expects token info from the tabs hash string but it seems like that hash no longer gets set for non-Cordova Meteor apps.

Might have a play around to see how far I get but thought of raising it up here. Awesome library by the way.

find & findOne

In your todo list demo you're using find and findOne methods on your collections, the latest version doesn't include these. Any reason for this?

Sort and Limit

Do you have an example of how this could be achieved?

Thanks

Query not working on data change for boolean?

I have a query like notifications.reactiveQuery({"read":false}), which returns records fine, when a record read attr changes to true (via a meteor.call 'clearNotification'), the query doesn't seem to catch the change. my current workaround is to rerun the query in the updated promise from my meteor.call method

I can tweak the read attr in the db and it works as you expect. not sure if its something i'm missing ?

var unreadNotificationQuery = notifications.reactiveQuery({"read":false});
  unreadNotificationQuery.on('change',function (change) {   
    console.log("change")
    $scope.notifications =  unreadNotificationQuery.result
    $scope.$apply()
  }) 

$scope.clearNotification = function(notification) {
    call = meteor.call('clearNotification',notification._id);    
    call.updated.then(function(){
      var q = notifications.reactiveQuery({"read":false});      
      $scope.notifications =  q.result 
      $scope.$apply() 
    })
  }

Communicate login information

Hi,

I have a chrome extension that uses Twitter Sign in.
Also, I have a Meteor client that uses Twitter Sign in.

How can I sign in once and affect the other?

eg. I login on the meteor client and now the chrome extension is also logged.

Thank you.

Update the docs

Since in this 0.3.0 Version you put up a major change on Asteroid, could you redo the To Do app for the moment? I current have to read the asteroid test file to figure out the new updates

In the long run it will definitely update the document.

API change suggestion

Use find instead of reactiveQuery, and return a cursor with fetch and observe methods.

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.