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

Intermittent message submission failure when using --user-mention flag #225

Closed
atc0005 opened this issue Mar 9, 2022 · 10 comments
Closed
Assignees
Labels
bug Something isn't working delivery
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Mar 9, 2022

Output:

[send2teams] 2022/03/09 16:26:30 main.go:239:

ERROR: Failed to submit message to "unspecified" channel in the "unspecified" team: failed to process response: error on notification: 400 Bad Request, "Invalid webhook request - Empty Payload"

When I use the --verbose flag I can see that the JSON payload has a message, but still the messages persists.

@atc0005 atc0005 added bug Something isn't working delivery labels Mar 9, 2022
@atc0005 atc0005 added this to the Future milestone Mar 9, 2022
@atc0005 atc0005 self-assigned this Mar 9, 2022
@atc0005
Copy link
Owner Author

atc0005 commented Mar 9, 2022

Ran into this when testing a maintenance script that pings me after each long running step completes. Out of the four expected notifications, 1 continually fails and 3 succeed.

Not sure if it's a timing issue or if the barely supported "botapi" format provided by the atc0005/go-teams-notify project will continue to have this problem.

@atc0005
Copy link
Owner Author

atc0005 commented Mar 9, 2022

Out of the four expected notifications, 1 continually fails and 3 succeed.

Just had it fail 2 out of the 4 times.

@atc0005
Copy link
Owner Author

atc0005 commented Mar 9, 2022

In contrast, not using the --user-mention flag successfully sent 4/4 times, then again when I re-ran the script.

@atc0005 atc0005 changed the title Intermittent message submission when using --user-mention flag Intermittent message submission failure when using --user-mention flag Mar 10, 2022
@atc0005
Copy link
Owner Author

atc0005 commented Apr 2, 2022

Now that the work on atc0005/go-teams-notify#157 has sufficiently progressed, I'm working on a fix for this GH issue. Hoping to cut a new release for this project within the next week (or so).

@atc0005
Copy link
Owner Author

atc0005 commented Apr 4, 2022

Now that the work on atc0005/go-teams-notify#157 has sufficiently progressed, I'm working on a fix for this GH issue. Hoping to cut a new release for this project within the next week (or so).

Note: Most of the "temporary" restrictions of using user mentions support and losing out on other support looks like it will persist:

Incompatible with target-url, title and color flags.

The title flag can be mimicked, the target-url flag can be supported with an Adaptive Card equivalent, but there doesn't appear to be an equivalent option for the color flag. Validation can be adjusted to still bail early if the color flag is provided alongside the user-mention flag, but allow use of the target-url flag with the user-mention flag.

@atc0005
Copy link
Owner Author

atc0005 commented Apr 4, 2022

Note: Testing/research shows that the convert-eol flag is incompatible with Adaptive Cards. Instead of adding line breaks as intended, the results are interpreted as-is with <br> elements visible in the delivered message.

Will likely need to reject use of that if used alongside the user-mention flag.

@atc0005
Copy link
Owner Author

atc0005 commented Apr 7, 2022

Beginning testing against existing environments that rely on MessageCard support. Considering dropping support for that format.

@atc0005 atc0005 modified the milestones: Future, Next Release Apr 8, 2022
@atc0005
Copy link
Owner Author

atc0005 commented Apr 8, 2022

Beginning testing against existing environments that rely on MessageCard support. Considering dropping support for that format.

Going in this direction. We can bring back support for generated MessageCard payloads later if requested.

@atc0005
Copy link
Owner Author

atc0005 commented Apr 9, 2022

Validation can be adjusted to still bail early if the color flag is provided alongside the user-mention flag, but allow use of the target-url flag with the user-mention flag.

Opting to treat the flag as a NOOP, document as much in the README and in the help text. This should help ensure that the next release of this app is unlikely to break existing deployments.

atc0005 added a commit to atc0005/go-teams-notify that referenced this issue Apr 10, 2022
Add early (and incomplete) implementation of `Adaptive Card` format
(new `adaptivecard` package). This new package is an alternative to
the current implementation of the legacy `MessageCard` format
(`messagecard` package).

Remove `botapi` package. This package was a partial implementation and
intended as a temporary resource until the `adaptivecard` package was
developed sufficiently to replace it. This package could make an
appearance later in a more complete form if there is need for it.

CHANGES

The changes listed here are in comparison to the previous
v2.7.0-alpha.1 release.

- add initial implementation of the `adaptivecard` package
- remove partial implementation of `botapi` package
  - incomplete implementation, known issues (atc0005/send2teams#225)
- example code
  - create subdir for new `adaptivecard` examples and populate with
    equivalents
  - create subdir for existing `messagecard` examples
  - refresh doc comments of existing examples
  - attempt to simplify implementation of examples
- documentation refresh
  - cover new features provided by the new `adaptivecard` package
  - make note of plans to extend v2 branch features while retaining
    backwards compatibility with an eye towards a future v3 series
- add `goteamsnotify.InList()` helper func
- simplify `goteamsnotify.messagePreparer` interface
- simplify `MessageCard.Prepare()` implementation
- explicitly mark files containing exclusively deprecated code
- explicitly mark existing formatting functionality as specific to the
  `MessageCard` format

LIMITATIONS

- the `adaptivecard` package is new and its API is subject to change
  before the next stable release
- the `adaptivecard` package is incomplete
  - while the new package contains sufficient functionality to be
    useful and provide a close approximation of functionality to the
    existing `messagecard` package, it is still missing support for
    some (available) features that the older package provides
- there are many TODO items for the new `adaptivecard` package, most
  of which are intended to be removed before the next stable release
- there are active `gocognit` linter warnings for the `Validate()`
  method for multiple types in the new `adaptivecard` package
  - this method is responsible for asserting known requirements for
    multiple field values for its type
  - more "bake time" is needed to determine a simpler approach

REFERENCES

- refs GH-157
- refs atc0005/send2teams#225
atc0005 added a commit that referenced this issue Apr 10, 2022
OVERVIEW

Resolve intermittent user mention submission failure by swapping out
the `botapi` implementation of user mention support for the new
`adaptivecard` package. This new package generates payloads with user
mentions that fully comply with published Microsoft Teams requirements.

Temporary restrictions applied in the last release between user
mentions and the URL "buttons", title flags have been removed.

This app now exclusively uses the `adaptivecard` package.
Unfortunately, the `Adaptive Card` format does not (at the time of
this writing) support message color theming (border trim color). This
flag now is a NOOP; while using this flag does not produce an error,
it no longer does anything.

CHANGES

- replace `botapi` and `messagecard` packages with `adaptivecard`
  package
- exclusively use `adaptivecard` package to generate Microsoft Teams
  messages
- add missing checks for use of `--silent` flag before emitting
  warning/error output
- resolve intermittent user mention submission failure
- the `--target-url` flag no longer enforces a set limit of 4 URL
  "buttons"
- documentation
    - the current Microsoft Teams message size limit of
      *approximately* 28 KB is explicitly noted
    - references to the `references to the `--color` flag have been
      removed (aside from the explicit NOOP behavior in the config
      flag table)
    - mention that the generated JSON payload is now emitted in
      verbose ouput (exposed via the `--verbose` flag)

REFERENCES

- refs GH-225
- refs atc0005/go-teams-notify#162
atc0005 added a commit that referenced this issue Apr 10, 2022
OVERVIEW

Resolve intermittent user mention submission failure by swapping out
the `botapi` implementation of user mention support for the new
`adaptivecard` package. This new package generates payloads with user
mentions that fully comply with published Microsoft Teams requirements.

Temporary restrictions applied in the last release between user
mentions and the URL "buttons", title flags have been removed.

This app now exclusively uses the `adaptivecard` package.
Unfortunately, the `Adaptive Card` format does not (at the time of
this writing) support message color theming (border trim color). This
flag now is a NOOP; while using this flag does not produce an error,
it no longer does anything.

CHANGES

- replace `botapi` and `messagecard` packages with `adaptivecard`
  package
- exclusively use `adaptivecard` package to generate Microsoft Teams
  messages
- add missing checks for use of `--silent` flag before emitting
  warning/error output
- resolve intermittent user mention submission failure
- the `--target-url` flag no longer enforces a set limit of 4 URL
  "buttons"
- documentation
    - the current Microsoft Teams message size limit of
      *approximately* 28 KB is explicitly noted
    - references to the `references to the `--color` flag have been
      removed (aside from the explicit NOOP behavior in the config
      flag table)
    - mention that the generated JSON payload is now emitted in
      verbose ouput (exposed via the `--verbose` flag)

REFERENCES

- refs GH-225
- refs atc0005/go-teams-notify#162
atc0005 added a commit that referenced this issue Apr 11, 2022
OVERVIEW

Resolve intermittent user mention submission failure by swapping out
the `botapi` implementation of user mention support for the new
`adaptivecard` package. This new package generates payloads with user
mentions that fully comply with published Microsoft Teams requirements.

Temporary restrictions applied in the last release between user
mentions and the URL "buttons", title flags have been removed.

This app now exclusively uses the `adaptivecard` package.
Unfortunately, the `Adaptive Card` format does not (at the time of
this writing) support message color theming (border trim color). This
flag now is a NOOP; while using this flag does not produce an error,
it no longer does anything.

CHANGES

- replace `botapi` and `messagecard` packages with `adaptivecard`
  package
- exclusively use `adaptivecard` package to generate Microsoft Teams
  messages
- add missing checks for use of `--silent` flag before emitting
  warning/error output
- resolve intermittent user mention submission failure
- the `--target-url` flag no longer enforces a set limit of 4 URL
  "buttons"
- documentation
    - the current Microsoft Teams message size limit of
      *approximately* 28 KB is explicitly noted
    - references to the `--color` flag have been removed (aside
      from the explicit NOOP behavior in the config flag table)
    - mention that the generated JSON payload is now emitted in
      verbose ouput (exposed via the `--verbose` flag)

REFERENCES

- refs GH-225
- refs atc0005/go-teams-notify#162
atc0005 added a commit that referenced this issue Apr 11, 2022
OVERVIEW

Resolve intermittent user mention submission failure by swapping out
the `botapi` implementation of user mention support for the new
`adaptivecard` package. This new package generates payloads with user
mentions that fully comply with published Microsoft Teams requirements.

Temporary restrictions applied in the last release between user
mentions and the URL "buttons", title flags have been removed.

This app now exclusively uses the `adaptivecard` package.
Unfortunately, the `Adaptive Card` format does not (at the time of
this writing) support message color theming (border trim color). This
flag now is a NOOP; while using this flag does not produce an error,
it no longer does anything.

CHANGES

- replace `botapi` and `messagecard` packages with `adaptivecard`
  package
- exclusively use `adaptivecard` package to generate Microsoft Teams
  messages
- add missing checks for use of `--silent` flag before emitting
  warning/error output
- resolve intermittent user mention submission failure
- the `--target-url` flag no longer enforces a set limit of 4 URL
  "buttons"
- documentation
    - the current Microsoft Teams message size limit of
      *approximately* 28 KB is explicitly noted
    - references to the `--color` flag have been removed (aside
      from the explicit NOOP behavior in the config flag table)
    - mention that the generated JSON payload is now emitted in
      verbose ouput (exposed via the `--verbose` flag)

REFERENCES

- refs GH-225
- refs atc0005/go-teams-notify#162
@atc0005
Copy link
Owner Author

atc0005 commented Apr 11, 2022

Resolved per GH-228.

@atc0005 atc0005 closed this as completed Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working delivery
Projects
None yet
Development

No branches or pull requests

1 participant