Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

fix: allow spec reload

Open
#90 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
kotlin
Domain
tooling

Research direction

Start in devview-networkmock-core/src/commonMain/kotlin/com/worldline/devview/networkmock/core/repository/MockConfigRepository.kt, reading cachedConfig and loadConfiguration(). Trace NetworkMockViewModel.loadConfiguration() and the existing Reset to Network action in NetworkMock.kt if considering UI exposure. Done means invalidation causes a later load to re-read and re-parse changed resource content, with downstream configuration refreshed as needed.

Written by the indexing model from the issue text.

Description

bug

Summary

MockConfigRepository caches its parsed configuration forever after the first successful load, with no way to invalidate the cache and force a re-read. This is independent of the OpenAPI migration (tracked in the epic, #72) and can be picked up any time.

Current state

MockConfigRepository.loadConfiguration() (devview-networkmock-core/src/commonMain/kotlin/com/worldline/devview/networkmock/core/repository/MockConfigRepository.kt:201-254) checks cachedConfig (declared at :125) first and returns it immediately if present (:205-210), never re-reading the underlying resource. There is no method to clear this cache. In practice this means the mock configuration (mocks.json today, an OpenAPI spec after the migration in #72) can only ever be reloaded by restarting the process — there's no way for a developer to edit the config/spec file and see the change reflected without a full app restart, which is a meaningfully worse dev-loop than most things this tool is meant to speed up.

What to build

  • Add a way to invalidate/clear cachedConfig, either as a new public method (e.g. invalidateCache() / reload()) or as a parameter on loadConfiguration() (e.g. loadConfiguration(forceReload: Boolean = false)).
  • Decide whether this should be surfaced in the UI (e.g. the existing "Reset to Network" toolbar action pattern in NetworkMock.kt:131-158 is a reasonable precedent for adding a second toolbar action, "Reload config") or left as a repository-level API for now, and note the decision in the PR.
  • Consider whether reloading needs to also re-run registerEndpoints/response-discovery downstream (NetworkMockViewModel.loadConfiguration(), devview-networkmock/src/commonMain/kotlin/com/worldline/devview/networkmock/viewmodel/NetworkMockViewModel.kt:138-193) — likely yes, since a changed config could add/remove/rename operations.

Acceptance criteria

  • There is a way to force MockConfigRepository to re-read and re-parse its underlying resource after the first load.
  • Calling the invalidation path and then reloading picks up changes to the underlying file (test with a resource loader stub that returns different content on a second call).
  • If surfaced in the UI, it follows the existing "Reset to Network" action pattern for consistency.

Files likely touched

  • devview-networkmock-core/src/commonMain/kotlin/com/worldline/devview/networkmock/core/repository/MockConfigRepository.kt
  • devview-networkmock/src/commonMain/kotlin/com/worldline/devview/networkmock/NetworkMock.kt (if surfaced in the UI)
  • devview-networkmock/src/commonMain/kotlin/com/worldline/devview/networkmock/viewmodel/NetworkMockViewModel.kt (if surfaced in the UI)
Dominant language
Kotlin
Stars
10
Forks
2
Avg merge
2d 14h
Merged PRs (30d)
13

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from worldline/devview

All issues in worldline/devview

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.