# edit prediction: Report early-rejected predictions and fix cancel bug \(\#43585\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/f89e5308e38c2c8e62f07dc0d641e61079569767)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: f89e5308e38c2c8e62f07dc0d641e61079569767

Requested commit: f89e5308e38c2c8e62f07dc0d641e61079569767

Commit: f89e5308e38c2c8e62f07dc0d641e61079569767

Tree: 584c51a8a542dba35190fdafbfe2b10cb5b40c9b

Author: Agus Zubiaga

Committer: GitHub

## Message

```
edit prediction: Report early-rejected predictions and fix cancel bug (#43585)

Many prediction requests end up being rejected early without ever being
set as the current prediction. Before this change, those cases weren’t
reported as rejections because the `request_prediction_with_*` functions
simply returned `Ok(None)`.

With this update, whenever we get a successful response from the
provider, we will return at least the `id`, allowing it to be properly
reported. The request now also includes a “reject reason,” since the
different variants carry distinct implications for prediction quality.

All of these scenarios are now covered by tests. While adding them, I
also found and fixed a bug where some cancelled predictions were
incorrectly being set as the current one.

Release Notes:

- N/A

---------

Co-authored-by: MrSubidubi <dev@bahn.sh>
```

## Parents

- [61a414df77a49278b6c734b486d7cda419cf781e](https://git.cafe/gitcafe/zed/commit/61a414df77a49278b6c734b486d7cda419cf781e?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/f89e5308e38c2c8e62f07dc0d641e61079569767?format=markdown)
