Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#108] Improve block support #121

Merged
merged 4 commits into from
Sep 8, 2023
Merged

Conversation

dcastro
Copy link
Member

@dcastro dcastro commented Sep 8, 2023

Description

Problem: right now, when find an emoji block in a message, we split the
message in two. This means this message:

Hey, let's meet at 10:30 :clock1: tomorrow?

Will be interpreted as two separate sentences, ["Hey, let's meet at 10:30", "tomorrow?"], and "tomorrow" won't be taken into account.

Solution: skip over emoji blocks, and collate adjacent text-like blocks.
This is now parsed as a single sentence ["Hey, let's meet at 10:30 tomorrow?"]


Problem: The server reports warnings whenever it finds a message with a
tag like @user. Since this occurs very often, it ends up flooding the
logs.

Solution: Don't report warnings for blocks of type user, usergroup
and broadcast.

Related issue(s)

Fixed part of #108

✅ Checklist for your Pull Request

Related changes (conditional)

  • Tests

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from
      silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:

Stylistic guide (mandatory)

✓ Release Checklist

  • I updated the version number in package.yaml.
  • (After merging) I created a new entry in the releases page,
    with a summary of all user-facing changes.
    • I made sure a tag was created using the format vX.Y

Problem: right now, when find an emoji block in a message, we split the
message in two. This means this message:

```
Hey, let's meet at 10:30 🕐 tomorrow?
```

Will be interpreted as two separate sentences, `["Hey, let's meet at
10:30", "tomorrow?"]`, and "tomorrow" won't be taken into account.

Solution: skip over emoji blocks, and collate adjacent text-like blocks.
This is now parsed as a single sentence `["Hey, let's meet at 10:30
tomorrow?"]`
@dcastro dcastro force-pushed the diogo/#108-improve-block-support branch from bc3c5a7 to 4e57a2d Compare September 8, 2023 15:27
Problem: The example JSON in `justEverythingRaw` appears to have been
aeson-decoded and then aeson-encoded, which means the object keys have
been reordered alphabetically (that's what aeson does).

However, this makes it harder to reconstruct this JSON if we ever need
to. It's simpler to just paste the JSON we get directly from Slack's Web
API.

Solution: Paste the JSON exactly as returned by Slack's Web API.
Problem: The server reports warnings whenever it finds a message with a
tag like `@user`. Since this occurs very often, it ends up flooding the
logs.

Solution: Don't report warnings for blocks of type `user`, `usergroup`
and `broadcast`.
@dcastro dcastro force-pushed the diogo/#108-improve-block-support branch from 4e57a2d to 8160f7a Compare September 8, 2023 15:32
@dcastro dcastro enabled auto-merge September 8, 2023 15:32
@dcastro dcastro merged commit 1b63767 into main Sep 8, 2023
@dcastro dcastro deleted the diogo/#108-improve-block-support branch September 8, 2023 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant