alleyinteractive / alleyinteractive/alley-scripts

Last search request to return displays in post selector

Open
#428 0 comments 0 reactions 0 assignees View on GitHub
bug Post Selector
Dominant language
TypeScript
Stars
10
Forks
3
Avg merge
4d 22h
Merged PRs (30d)
2

Description

### Description of the bug

Somewhat related to #152: If the post selector makes multiple requests to the search endpoint, the last of those requests to return will be the one whose results are displayed, even if it wasn't the last request that was actually sent for the current search term.

### Steps To Reproduce

Add this snippet somewhere:

```
if ( 'par' === ( $_GET['search'] ?? '' ) ) {
sleep( 5 );
}
```

Open the post selector and the Network tab of your browser tools. Search for `park` in the post selector (or use a different word that works better with your test data). You should see search requests for `par` and `park`.

The request for `park` will return first and populate the selector results. The request for `par` returns second, and the results for that search will replace the results that were there for `park`.

### Additional Information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.