Skip to content

fix(middleware-logger): retrieve filter overrides after middleware returns #4502

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

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

kuhe
Copy link
Contributor

@kuhe kuhe commented Mar 8, 2023

Description

A previous PR #4252 changed the order of the next() call and filter override retrieval in the logger middleware.
This PR fixes that.

Testing

const { DynamoDB } = require("@aws-sdk/client-dynamodb");
const { DynamoDBDocument } = require("@aws-sdk/lib-dynamodb");

const d = new DynamoDB({
  // logger: {
  //   ...console,
  //   debug() {},
  // },
});
const c = DynamoDBDocument.from(d);

(async () => {
  await c.put({
    TableName: "test",
    Item: {
      id: "123",
      NullField: null,
      NestedNullField: 5,
      Status: "blah",
    },
  });

  console.log(
    await c.get({
      TableName: "test",
      Key: {
        id: "123",
      },
    })
  );
})();

Above test results in an error without this fix.

@kuhe kuhe requested a review from a team as a code owner March 8, 2023 19:31
@kuhe kuhe merged commit 6405a58 into aws:main Mar 8, 2023
@kuhe kuhe deleted the fix/logger branch March 8, 2023 20:46
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants