Code Monkey home page Code Monkey logo

meteor-publish-join's People

Contributors

arunoda avatar jamielob avatar lmachens avatar nlhuykhang avatar roonyh avatar simonsimcity avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

meteor-publish-join's Issues

Endless loop when trying to stop publish worker

You pointed out in the comment in line 31 that this method

export function stopPublishWorker(store) {
if (typeof Meteor !== 'undefined') {
const handler = store.getWorkerHandler();
store.setWorkerHandler(null);
if (handler) {
Meteor.clearTimeout(handler);
return;
}
// XXX Could there be any issues causing this run forever?
Meteor.setTimeout(() => stopPublishWorker(store), 200);
}
}

bares the potential for an endless loop.

Well, I got into it. I'm currently investigating on how this could occur. Please let me know if you are suspecting something or might have a helpful insight here.

RangeError: Maximum call stack size exceeded

On my publication (server):

import { Meteor } from 'meteor/meteor';
import { JoinServer } from 'meteor-publish-join';
import DataTable1 from '../index';

const LIMIT = 50;

Meteor.publish('DataTable1.list', function({ projectId, type, searchText, searchFields }, { limit = LIMIT, skip = 0 }) {
  if (!this.userId) {
    return this.ready();
  }

  // TODO: validate args
  const query = { projectId, type };

  if (searchText?.length > 0) {
    Object.assign(query, composeSearchQueryParams(searchText, searchFields));
  }

  const queryOptions = { sort: { createdAt: -1 }, limit, skip };
  const data = DataTable1.find(query, queryOptions);
  JoinServer.publish({
    context: this,
    name: 'DataTable1listcount',
    interval: 10000,
    doJoin() {
 // I also tried
//      return Meteor.users.find({});
// return DataTable1.find(query); 
// same error
     return DataTable1.find({});
    },
  });
  return data;
});

On the client (I'm using react react-komposer):

export default composeWithTracker(({ inlineCreate, collection, page = 1, limit = 20, setPage, searchText }, onData) => {
  const { projectId, type } = collection;
  const subscription = Meteor.subscribe('DataTable1.list', { projectId, type, searchText:'', searchFields }, { limit, skip: (page-1) * limit });
  const count = JoinClient.get('DataTable1listcount');
  console.log('count', count)
  if (subscription.ready()) {
    const categories = DataTable1.find({ projectId, type }, { sort: { createdAt: -1 } }).fetch();
    // const count = Counts.get('DataTable1.list.count');

    const totalPages = Math.ceil(count/limit) || 1;
    onData(null, { categories, inlineCreate, totalPages,  onPageChange: setPage, searchText });
  }
}, Loading)(withPagination(CollectionDataList));

But I keep getting
RangeError: Maximum call stack size exceeded

[email protected]
"meteor-publish-join": {
"version": "1.1.7",

Is the result shared if many clients subscribe?

Just a question to get this right the first time:

I'm working on a tool, where we'll have to publish a lot of these publications, often not related to a user. We'll also have quite some clients that will subscribe on those.

Will the agregation/query be re-run for every client, subscribing on this publication in the given interval, or is there a possibility, where I can save the value globally, so the next client, subscribing to it, will get the already computed one if it isn't the right time to re-run the computation?

ReferenceError: Meteor is not defined

For some reason I'm getting this error:

W20170120-17:40:14.015(0)? (STDERR) ReferenceError: Meteor is not defined
W20170120-17:40:14.015(0)? (STDERR)     at Object.<anonymous> (.....\node_modules\meteor-publish-join\dist\server\index.js:49:5)
W20170120-17:40:14.015(0)? (STDERR)     at Module._compile (module.js:409:26)
W20170120-17:40:14.015(0)? (STDERR)     at Object.Module._extensions..js (module.js:416:10)
W20170120-17:40:14.015(0)? (STDERR)     at Module.load (module.js:343:32)
W20170120-17:40:14.015(0)? (STDERR)     at Function.Module._load (module.js:300:12)
W20170120-17:40:14.015(0)? (STDERR)     at Module.require (module.js:353:17)
W20170120-17:40:14.015(0)? (STDERR)     at require (internal/module.js:12:17)
W20170120-17:40:14.015(0)? (STDERR)     at Object.<anonymous> (......\node_modules\meteor-publish-join\dist\index.js:8:15)
W20170120-17:40:14.016(0)? (STDERR)     at Module._compile (module.js:409:26)
W20170120-17:40:14.016(0)? (STDERR)     at Object.Module._extensions..js (module.js:416:10)

I'm using this in a Meteor project, so I'm not sure where this is coming from.

Any ideas?

Do not wait for initial join

Hi, thx for this great package!
But it looks like, that the publication is waiting for the interval before processing the first doJoin().
So with a interval of 30 seconds the first join is processed after 30 seconds.

Is it possible to configure that behaviour?

Has version 1.2.0 already been published?

Today, I ran meteor npm outdated in my repository and saw, that there is a new version - version 1.2.0 - which isn't part of this repository. Do you know anything about it? If yes, could you tag it on this repository, so I can follow along on the changes that are included there?

EDIT: I've installed this version and it didn't include the changes, done in 1.1.4. In fact, it seems to be a version published after #4 was merged.

Switch out `node-uuid` in favor for `uuid`

This shouldn't be much of an issue. Please replace the dependency node-uuid by uuid. The package node-uuid is deprecated and it's features have been merged into uuid.

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.