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

Update QueueAdapterOptions typing #652

Merged
merged 2 commits into from
Nov 24, 2023
Merged

Update QueueAdapterOptions typing #652

merged 2 commits into from
Nov 24, 2023

Conversation

AlexisAnzieu
Copy link
Contributor

Thanks for your awesome work!

Here is a typing PR to add the ability to modify one attribute only and not the whole option object.

image

in order to modify one attribute only
@AlexisAnzieu AlexisAnzieu changed the title Update QueueAdapterOptions Update QueueAdapterOptions typing Nov 23, 2023
@felixmosh
Copy link
Owner

Hi, @AlexisAnzieu thank you for wanting to contribute, but all QueueAdapters are defined with Partial<> as needed.

constructor(private queue: Queue, options: Partial<QueueAdapterOptions> = {}) {

What is the TS error that you get?

@gboudreau
Copy link

Hi @felixmosh. (I work with Alexis.)

The error is:

error TS2739: Type '{ readOnlyMode: true; }' is missing the following properties from type 'QueueAdapterOptions': allowRetries, prefix, description

55       options: {
         ~~~~~~~

  node_modules/@bull-board/nestjs/dist/bull-board.types.d.ts:18:5
    18     options?: QueueAdapterOptions;
           ~~~~~~~
    The expected type comes from property 'options' which is declared here on type 'BullBoardQueueOptions'

Our code that triggers this error:

@Module({
  // ...
  imports: [
    // ...
    BullBoardModule.forFeature({
      name: QueueName.OPENAI,
      adapter: BullAdapter,
      options: {
        readOnlyMode: true,
      },
    }),
  ],
})

@felixmosh
Copy link
Owner

Hi, thanx for the clarification, can you change the PR, so that the usage of this type will use Partial<> (inside nest module)

@felixmosh felixmosh merged commit b5ace07 into felixmosh:master Nov 24, 2023
3 checks passed
@AlexisAnzieu AlexisAnzieu deleted the patch-1 branch November 24, 2023 16:23
@felixmosh
Copy link
Owner

felixmosh commented Nov 24, 2023

Released in v5.9.2
Thank you for your PR 🙏🏼

@AlexisAnzieu
Copy link
Contributor Author

AlexisAnzieu commented Nov 24, 2023

Thank you for your responsiveness 🚀

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.

3 participants