Fix at mention that triggers ephemeral message (#6458)

* Fix at mention that triggers ephemeral message

* Properly handle failed posts
This commit is contained in:
Daniel Espino García
2022-07-07 12:12:31 +02:00
committed by GitHub
parent 6a3c600c8a
commit e481c07630
4 changed files with 57 additions and 37 deletions

View File

@@ -98,6 +98,13 @@ const PostsInChannelHandler = (superclass: any) => class extends superclass {
}
if (targetChunk) {
if (
targetChunk.earliest <= earliest &&
targetChunk.latest >= latest
) {
return [];
}
// If the chunk was found, Update the chunk and return
if (prepareRecordsOnly) {
targetChunk.prepareUpdate((record) => {
@@ -202,6 +209,10 @@ const PostsInChannelHandler = (superclass: any) => class extends superclass {
let targetChunk = chunks[0];
if (targetChunk) {
if (targetChunk.earliest <= earliest) {
return [];
}
// If the chunk was found, Update the chunk and return
if (prepareRecordsOnly) {
targetChunk.prepareUpdate((record) => {
@@ -258,6 +269,10 @@ const PostsInChannelHandler = (superclass: any) => class extends superclass {
let targetChunk = chunks[0];
if (targetChunk) {
if (targetChunk.latest >= latest) {
return [];
}
// If the chunk was found, Update the chunk and return
if (prepareRecordsOnly) {
targetChunk.prepareUpdate((record) => {