Skip to content

Commit 8301cba

Browse files
authored
o365: fix handling of error conditions when requesting work continuation (#15380)
CEL type(o.f) == T does not work the same way as painless o.f instanceof T if f is not in o. It is necessary to check for existence first. In this case, this can be done either by directly checking for the existence of events in state, or because of an invariant in the program, by the absence of error in state. The latter is chosen for clarity and to ensure that the invariant is kept.
1 parent cfe8712 commit 8301cba

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

packages/o365/changelog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# newer versions go on top
2+
- version: "2.29.1"
3+
changes:
4+
- description: Fix handling of error conditions when requesting work continuation.
5+
type: bugfix
6+
link: https://github.com/elastic/integrations/pull/15380
27
- version: "2.29.0"
38
changes:
49
- description: Tolerate undocumented API changes in request parameter syntax.

packages/o365/data_stream/audit/agent/stream/cel.yml.hbs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,10 @@ program: |-
483483
).as(state,
484484
// Make sure we complete the remaining work if we got
485485
// no events but the work lists are not empty.
486-
(state.want_more && type(state.events) == list && size(state.events) == 0) ?
486+
// We do not need to put a dummy event in in the
487+
// case that we have errored, since the error will
488+
// be raised to an event by the input.
489+
(state.want_more && !has(state.error) && type(state.events) == list && size(state.events) == 0) ?
487490
state.with(
488491
{
489492
"events": [{"retry": true}],

packages/o365/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: o365
22
title: Microsoft Office 365
3-
version: "2.29.0"
3+
version: "2.29.1"
44
description: Collect logs from Microsoft Office 365 with Elastic Agent.
55
type: integration
66
format_version: "3.2.3"

0 commit comments

Comments
 (0)