Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Meteor 发布方法将数据泄漏到错误的客户端_Meteor - Fatal编程技术网

Meteor 发布方法将数据泄漏到错误的客户端

Meteor 发布方法将数据泄漏到错误的客户端,meteor,Meteor,我的发布功能有什么明显的问题吗 我所看到的行为是,当两个客户端都订阅此服务时,它们似乎都获得了“最新”的结果集(最近的订阅请求)。这意味着客户端正在从不同的订阅请求中获取泄漏的数据 非常感谢 约翰 更新:我已经使它正常工作,但我看不出任何替代方法工作的理由 if (this.userId && Meteor.users.findOne(this.userId).profile && Meteor.users.findOne(this.userId).profi

我的发布功能有什么明显的问题吗

我所看到的行为是,当两个客户端都订阅此服务时,它们似乎都获得了“最新”的结果集(最近的订阅请求)。这意味着客户端正在从不同的订阅请求中获取泄漏的数据

非常感谢

约翰

更新:我已经使它正常工作,但我看不出任何替代方法工作的理由

  if (this.userId && Meteor.users.findOne(this.userId).profile && Meteor.users.findOne(this.userId).profile.folder)

  return MyFiles.find({
    $or: [
  {key: new RegExp('^' + Meteor.users.findOne(this.userId).profile.folder + '/')}, {key: new RegExp('^' + 'Team files/')}]
  });

客户端A是否在客户端B订阅时收到“泄漏”的文件,或者即使没有客户端B订阅也会发生这种情况?我可以轻松复制的示例是。。。A订阅并可以查看A的文件。当B订阅时,B会看到A的文件。以B重新订阅也有同样的效果-发布查询返回的文件是正确的,但是客户端看到的结果就像是以A订阅一样。让我发疯哈哈!
  if (this.userId && Meteor.users.findOne(this.userId).profile && Meteor.users.findOne(this.userId).profile.folder)

  return MyFiles.find({
    $or: [
  {key: new RegExp('^' + Meteor.users.findOne(this.userId).profile.folder + '/')}, {key: new RegExp('^' + 'Team files/')}]
  });