famedly / matrix-dart-sdk

Matrix SDK written in pure Dart.
GNU Affero General Public License v3.0
52 stars 30 forks source link

fix: canRequestHistory doesn't reflect reality #1809

Closed nico-famedly closed 2 months ago

nico-famedly commented 3 months ago

canRequestHistory could become false, even though you didn't load all events from the database yet. So you had to either rely on fetching until the requestHistory method throws or rely on other workarounds.

This makes requestHistory not throw, when the prev_batch is null, but also makes canRequestHistory return sane values (but might require an extra request, that does nothing).