Code Monkey home page Code Monkey logo

Comments (4)

MaximusAshraf99 avatar MaximusAshraf99 commented on May 30, 2024

I am facing the same issue.
any updates?

from algoliasearch-helper-flutter.

MaximusAshraf99 avatar MaximusAshraf99 commented on May 30, 2024

As a workaround, you can add a space to your query if it is the same as the last one, and it will be handled like a new search and return the expected result

from algoliasearch-helper-flutter.

VladislavFitz avatar VladislavFitz commented on May 30, 2024

Hi @Ragnarokr45, @MaximusAshraf99,

Apologies for the late response.

We have a unit test that verifies the expected behavior of the rerun method. To further investigate, could you set up a basic test on your end? Here's what you'd need to do:

  • Instantiate a searcher.
  • Subscribe to its responses stream and collect the responses in a list.
  • Use the query method to initiate a search.
  • Rerun the same search.
  • Afterwards, verify if your list of responses contains exactly 2 entries.

This test procedure might be structured like this:

final searcher = HitsSearcher(
  applicationID: 'your_app_id',
  apiKey: 'your_api_key',
  indexName: 'your_index',
);

final responses = <SearchResponse>[];
searcher.responses.listen(responses.add);

for (var i = 0; i < 3; i++) {
  searcher.query('sony');
  await Future.delayed(const Duration(milliseconds: 500));
}

expect(
  responses.length,
  1,
  reason: 'Only one response should be emitted for duplicate queries',
);

searcher.rerun();
await Future.delayed(const Duration(milliseconds: 500));

expect(
  responses.length,
  2,
  reason: '2 responses should be emitted after rerun',
);

If this test works as expected and you receive two responses, it indicates that the functionality is operating correctly. In such a case, I would recommend reviewing your implementation to pinpoint potential discrepancies that might be causing different behavior in your environment.

from algoliasearch-helper-flutter.

Related Issues (20)

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.