Skip to content

chore(config): refactor all signaling server related configs to AppConfig - #19915

Open
sudormant wants to merge 1 commit into
mainfrom
refactor/config/RefactorTalkConfigToAppConfig7
Open

sudormant wants to merge 1 commit into
mainfrom
refactor/config/RefactorTalkConfigToAppConfig7

Conversation

@sudormant

Copy link
Copy Markdown
Contributor

AI (if applicable)

  • The content of this PR was partly or fully generated using AI:
    • taken getRealAppConfig() code suggestion with changes from Claude Opus 5.5.

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not possible
  • 📘 API documentation in docs/ has been updated or is not required
  • 🔖 Capability is added or not needed

refactoring all signaling server related configs to AppConfig.

These unit test failures are expected and solved by #19400:
There were 3 failures:

  1. OCA\Talk\Tests\BackgroundJob\CheckHostedSignalingServerTest::testRunWithNoChange
    Expectation failed for method name is "fetchAccountInfo" when invoked 1 time.
    Method was expected to be called 1 time, actually called 0 times.

  2. OCA\Talk\Tests\BackgroundJob\CheckHostedSignalingServerTest::testRunWithPendingToActiveChange
    Expectation failed for method name is "fetchAccountInfo" when invoked 1 time.
    Method was expected to be called 1 time, actually called 0 times.

  3. OCA\Talk\Tests\BackgroundJob\CheckHostedSignalingServerTest::testRunWithPendingToActiveIncludingStunAndTurn
    Expectation failed for method name is "fetchAccountInfo" when invoked 1 time.
    Method was expected to be called 1 time, actually called 0 times.

Checking CI for tests and clean occ app config as some types were enforced.

needs further cleaning up, tests validations, polishing and checks that signaling_servers is used as the same array type everywhere, [servers] vs [secret] vs [server, server..]

@sudormant sudormant self-assigned this Oct 19, 2026
@sudormant sudormant added feature: settings ⚙️ Settings and config related issues feature: signaling 📶 Internal and external signaling backends technical debt labels Oct 19, 2026
@sudormant sudormant added this to the ☃️ Next Major (36) milestone Oct 19, 2026
@sudormant
sudormant force-pushed the refactor/config/RefactorTalkConfigToAppConfig7 branch 3 times, most recently from 9836447 to b722524 Compare October 20, 2026 07:00
…nfig

Signed-off-by: Christian Lorang <christian.lorang@nextcloud.com>
@sudormant
sudormant force-pushed the refactor/config/RefactorTalkConfigToAppConfig7 branch from b722524 to c687178 Compare October 20, 2026 13:28
@sudormant

Copy link
Copy Markdown
Contributor Author

rebased after #19400 merge and cleaned up, unit tests now pass

signaling_servers is used as the same array type everywhere, [servers] vs [secret] vs [server, server..]

that behavior remains unchanged and should be checked / streamlined in another PR.

@sudormant
sudormant marked this pull request as ready for review October 20, 2026 13:49
Comment on lines +75 to +78
$this->initialState->provideInitialState(Config::SUMMARY_THRESHOLD, $this->appConfig->getAppValueInt(Config::SUMMARY_THRESHOLD, 100));
$this->initialState->provideInitialState(Config::MAX_CALL_DURATION, $this->appConfig->getAppValueInt(Config::MAX_CALL_DURATION, 0));
$this->initialState->provideInitialState('valid_apache_php_configuration', $this->validApachePHPConfiguration());
$this->initialState->provideInitialState(Config::MATTERBRIDGE_ENABLED, $this->appConfig->getAppValueBool(Config::MATTERBRIDGE_ENABLED));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Those additions are not consumed in the frontend, so we don't need to expose them?

Comment thread lib/Config.php
public function getSignalingSecret(): string {
$config = $this->config->getAppValue('spreed', 'signaling_servers');
$signaling = json_decode($config, true);
$config = $this->appConfig->getAppValueString(Config::SIGNALING_SERVERS_SECRET);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm confused about this. Could we just migrate from A to B and do the splitting at another time?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The code has two places to store the secret for the signaling servers. sometimes it's in signaling_servers as the array member secret, sometimes it's in its dedicated config signaling_servers_secret, mostly in both but not always in sync.
It's not used consistently throughout the codebase. Sometimes it's set in one place and not the other, when deleting it in one place sometimes it also deletes it in the other but not always, sometimes when the value is checked it's checked in one place but not necessarily in the other.
That's what I tried to recreate here, just the other way around. Instead of looking at the array to check if it's there, check the dedicated config value and if that's empty, check the signaling_servers array if it's present.
We could reverse that again, however the code would then run into situations, where it's deleted the value from the signaling_servers array but not the signaling_servers_secret and then return a stale value.
The tests pass, but we could move it to a second PR?

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

Labels

feature: settings ⚙️ Settings and config related issues feature: signaling 📶 Internal and external signaling backends technical debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants