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

bug(tui): a locally created project is written to <path>/datatug/datatug-project.json but read from <path>/datatug-project.json, so it cannot be opened

Closed Beginner friendly
#263 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
cli

Research direction

Start with createLocalProject in apps/datatugapp/datatugui/dtproject/create_project_screen.go and compare its path handling with LoadProjectFile in pkg/storage/filestore/store_loader.go. Check project_creator_test.go for the expected root-level layout. Done means a locally created project can be opened and the writer and reader agree on the project file location.

Written by the indexing model from the issue text.

Description

What happens

A project created locally from the TUI cannot be opened afterwards: the create flow writes the project file one directory deeper than the reader looks for it, so opening the project it just created fails with ErrProjectDoesNotExist.

Trigger

Writer — createLocalProject in apps/datatugapp/datatugui/dtproject/create_project_screen.go puts the file inside a datatug subdirectory:

datatugDir := filepath.Join(projectPath, "datatug")
// ...
configFilePath := filepath.Join(datatugDir, storage.ProjectSummaryFileName)

giving <projectPath>/datatug/datatug-project.json.

Reader — the same flow then calls openProject, which builds a store on projectRef.Path (that same projectPath):

store := filestore.NewProjectStore(projectRef.ID, projectRef.Path)

and datatug-core's filestore.LoadProjectFile joins the file name straight onto that path, with no datatug segment (pkg/storage/filestore/store_loader.go):

func LoadProjectFile(projPath string) (v datatug.ProjectFile, err error) {
	fileName := path.Join(projPath, storage.ProjectSummaryFileName)

So the reader opens <projectPath>/datatug-project.json and nothing is there.

Core is consistent with its reader, not with this writer: filestore's own saver writes saveJSONFile(s.projectPath, storage.ProjectSummaryFileName, projFile), and dtprojcreator.CreateProjectFiles writes it at the project root too — core's project_creator_test.go asserts expectedPath := path.Join(projPath, storage.ProjectSummaryFileName). The TUI's extra datatug directory is the odd one out.

Expected

createLocalProject should write datatug-project.json at the project root, the one place every reader in core looks — or, if the datatug subdirectory is deliberate, projectRef.Path should point at it so the two agree. They must not disagree silently.

Worth deciding at the same time whether the now-empty datatug directory should still be created at all.

Notes

Found in review of #259, which changed the directory this file is written into (it is now named after the project id rather than the title) but not the layout below it — the mismatch predates that PR and is not fixed there. Sibling pre-existing defects on the neighbouring GitHub create path: #260, #261, #262.

Dominant language
Go
Stars
1
Forks
0
Avg merge
4h 42m
Merged PRs (30d)
141

Getting set up

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 datatug/datatug-cli

All issues in datatug/datatug-cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.