question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Filter functions not working

See original GitHub issue

On branch v1.0.0

SS:FilterFunction Reply filter function found: ^sigh("true") +19ms
  SS:Utils Running plugin function with name: sigh +1ms
  SS:Utils Calling plugin function: sigh with args: true,function (err, filterReply) {
                if (err) {
                  console.error(err);
                  return resolve(false);
                }

                if (filterReply === 'true' || filterReply === true) {
                  return resolve(true);
                }
                return resolve(false);
              } +8ms
 SS:FilterFunction Reply filter function found: ^sigh("false") +1ms
  SS:Utils Running plugin function with name: sigh +0ms
  SS:Utils Calling plugin function: sigh with args: false,function (err, filterReply) {
                if (err) {
                  console.error(err);
                  return resolve(false);
                }

                if (filterReply === 'true' || filterReply === true) {
                  return resolve(true);
                }
                return resolve(false);
              } +1ms
  SS:FilterSeen filterRepliesBySeen +1ms []
  SS:GetReply Bucket of selected replies:  +0ms []
  SS:GetReply Pick Scheme: +1ms random
  SS:GetReply Set of matches:  +2ms
  SS:GetReply afterHandle +5ms { replyId: null,
  replyIds: null,
  props: {},
  clearConversation: false,
  topicName: null,
  debug: [],
  string: '',
  subReplies: [],
  stars: null,
  continueMatching: null }
  SS:Message Message received was empty, callback immediately +0ms
Could not write log to file with path: /home/sephvelut/app/bot/logs/ffff127001_trans.txt.log
  SS:User Updating History +2ms
  SS:SuperScript Update and Reply to user '::ffff:127.0.0.1' +0ms
  SS:SuperScript [ Final Reply - '::ffff:127.0.0.1']- '' +1ms
+ test
- ok

+ qq
- {^sigh("true")} asd
- {^sigh("false")} poi
exports.sigh = function(bool, cb) {
        cb(null, false);
};

The filter function does get fired off, but the bot never replies with anything.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16

github_iconTop GitHub Comments

1reaction
silentrobcommented, Dec 30, 2016

For the sake of completion, we do have another system that might work… but it is for managing conversation state/flow.

+ __start__
- match here {id=123, bool=true,   str="string"  }

%% (bool == true)
  + boo ya
  - YES

%% (id == 123)
- winning
1reaction
bensalilijamescommented, Dec 30, 2016

I think the custom function should return true if you want to see the reply, and false if you want to filter it out, though I may be going crazy. Maybe it should be the other way around?

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 Reasons why your Excel filter may not be working
Another reason why your Excel filter may not be working may be due to merged cells. Unmerge any merged cells or so that...
Read more >
Excel filter not working properly [Fixed] - The Windows Club
Excel filter not working properly · 1] Check for error · 2] Select the entire data · 3] Unhide hidden rows and columns...
Read more >
FILTER function - Microsoft Support
The FILTER function filters an array based on a Boolean (True/False) array. ... Notes: An array can be thought of as a row...
Read more >
How to solve when filter function does not work properly in MS ...
One of the most common problem with filter function is that it stops working beyond a blank row. Filter will not include cells...
Read more >
7 Reasons☝️ Why Your Excel Filter May Not Be Working
1. Check that you have selected all the data. · 2. Check for errors. · 3. Check for hidden rows. · 4. Check...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found