Skip to content

Conversation

@rmnvch
Copy link
Contributor

@rmnvch rmnvch commented Nov 26, 2025

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation
  • Other... Please describe:

What is the current behaviour? (You can also link to an open issue here)
https://hyland.atlassian.net/browse/MNT-25408

What is the new behaviour?
Exposes 2 streams to watch filter change; adds Proxy to detect direct property assignment for BaseQueryBuilderService's queryFragments

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

});
}

private readonly queryFragmentsHandler: ProxyHandler<{ [key: string]: any }> = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

queryFragmentsHandler is private readonly field. It's not a function. So please move it above class to place where all fields are placed

return this._queryFragments;
}

set queryFragments(value: { [key: string]: any }) {
Copy link
Contributor

@AleksanderSklorz AleksanderSklorz Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two things:

  1. Can we set string instead of any because I see that queryFragments field has string as value type (right side)? If it works then it would be better option
  2. If no then see following
    Any here and in setter below give eslint issue. I know you don't know what the type will be as they can have any type but can we use different type than any like "uknown" or "never"? They are a bit safer alternatives
    https://rahuulmiishra.medium.com/typescripts-any-vs-unknown-vs-never-when-and-how-to-use-them-35d81ea57c01
image

Would it have sense to use one of those types?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AleksanderSklorz , minding that it's a library and type might be other than string, "unknown" would be the right choice. I've checked and all over the code inside of ADF we just once assign undefined there instead of string and that wouldn't be a problem. The problem I see is that we cannot just change it to 'unknown' because it would be a breaking change - some consumers would need type narrowing now, so I believe it should be supported by a sort of migration guide. Probably it should be a dedicated ticket for that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me ask Michał what steps we should do in that case. @MichalKinas can you help us make decision? You can check that comment and open comments below which are related

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unknow may throw some TS issues when compared with any other type so I would avoid it in that case, since it can take some other types except of string I think any usage would be justified here, we can think of suppresing the eslint warning there too

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants