Q:

Make Protractor poll promise until condition is met

I am writing Protractor tests for AngularJS with jasmine. I am tracking a row in a table which will move from an In Progress table to a Completed table.  It may take anywhere from 30 seconds up to 20 minutes for this move to occur. I need to make Protractor wait for the row to appear in the Completed table.
I am using 2 elements in the row to identify it as uniquely the row I am tracking.  The search function for this row is a complicated chain of element selectors and validations which returns a Promise that resolves to an object containing the row element. Roughly simplified:
searchForElement = function() {
  var response = element.all(by.repeater(...))
                 .then(...)
                 .then(...)
                 .filter(...)
                 .then(... 
                     //if found, response.value = element object 
                     //if not found, response.value = false
                  );
  return response;
};

I tried calling the search from within browser.wait(), but even when the row is found it remains stuck in browser.wait() and jasmine times out.  I have tried changing jasmine.DEFAULT_TIMEOUT_INTERVAL to 1500000 and also to 0, and it still times out.
browser.wait( function() {
  searchForElement().then( function (result) {
    // if result.value is an object, return true
  });
}, timeout).then( function() {
  // assertions
});

After searching the internet I tried using $interval, but I got errors saying that $interval is not defined.  Apparently it's not meant to be used for testing.
How can I poll the search function (which returns a Promise) on an interval such that it stops polling when the row is found on the Completed table, and times out after 25 minutes if the row is not found?

A:

SOLVED:  I had 2 mistakes.  
First, I was not returning true from the browser.wait loop.  So the search function had found the element, but it was stuck in the wait loop.  Here is my solution:
var visible = false;
browser.wait( function() {
  searchForElement().then( function (result) {
    // if result.value is an object, set visible to true
    visible = true;
  });
  return visible;
}, timeout).then( function() {
  // assertions
});

Second, if the timeout on the browser.wait was greater than jasmine.DEFAULT_TIMEOUT_INTERVAL, then the code could successfully exit the browser.wait and then immediately report a jasmine timeout because the it block did not complete within the jasmine timeout.
I also concluded that it is not necessary to use an interval to poll the search function because the search returns a Promise.  The browser.wait loop just keeps calling the search function until it gets the desired response.

