Skip to content

feat: Added fromCache method to AssetsCache#3740

Merged
spydon merged 4 commits intoflame-engine:mainfrom
sandy4242:main
Oct 8, 2025
Merged

feat: Added fromCache method to AssetsCache#3740
spydon merged 4 commits intoflame-engine:mainfrom
sandy4242:main

Conversation

@sandy4242
Copy link
Copy Markdown
Contributor

Description

The pr adds the fromCache from the images class to the assetcache class

Checklist

Breaking Change?

  • No, this PR is not a breaking change.

Related Issues

Closes #3736

@sandy4242
Copy link
Copy Markdown
Contributor Author

@spydon , hi please check if my implementation is good ??

Copy link
Copy Markdown
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

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

At least one test and potential docs need to be added.

}

/// This method provides synchronous access to cached assets, similar to
/// [Images.fromCache].
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.

This is referring to the wrong file.

Suggested change
/// [Images.fromCache].
/// [AssetsCache.fromCache].

@sandy4242
Copy link
Copy Markdown
Contributor Author

image image

i get these results when running melos run analyze, but while running tests i get errors saying Unable to load asset, The asset does not exist or has empty data.
what should i do?
and about the docs part, what should i update??

@spydon
Copy link
Copy Markdown
Member

spydon commented Oct 4, 2025

@sandy4242 analyze doesn't have anything to do with the tests. Push your test to the PR, it sounds like you haven't added the file to the cache before reading it.

@sandy4242
Copy link
Copy Markdown
Contributor Author

@spydon pushed it, why am i getting this as an error while running tests?
image

@spydon
Copy link
Copy Markdown
Member

spydon commented Oct 4, 2025

@spydon pushed it, why am i getting this as an error while running tests?
image

Is there a file named test_text_file.txt?

@sandy4242
Copy link
Copy Markdown
Contributor Author

sandy4242 commented Oct 4, 2025

@spydon here,
image

yes and its contents are This is sample text file for AssetsCache Unit testing.

@spydon
Copy link
Copy Markdown
Member

spydon commented Oct 5, 2025

@sandy4242 then you probably have the path to the file wrong, so that it looks in the wrong directory for it.

@spydon spydon changed the title refactor: Added fromCache method to AssetsCache feat: Added fromCache method to AssetsCache Oct 5, 2025
@sandy4242
Copy link
Copy Markdown
Contributor Author

@spydon hi, i did use alternative way to specify paths to find those assets but failed...so i asked ai to help me and its response was
image

what should i do??
any help or guide??

Copy link
Copy Markdown
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

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

I fixed up the tests. You're trusting AI too much, by looking at the new tests it was easy to see what was different in them compared to the old tests (they were missing the fixture call).

@spydon spydon enabled auto-merge (squash) October 8, 2025 11:35
@spydon spydon closed this Oct 8, 2025
auto-merge was automatically disabled October 8, 2025 11:50

Pull request was closed

@spydon spydon reopened this Oct 8, 2025
@spydon spydon enabled auto-merge (squash) October 8, 2025 11:50
@spydon spydon merged commit 33a7123 into flame-engine:main Oct 8, 2025
70 checks passed
@sandy4242
Copy link
Copy Markdown
Contributor Author

@spydon maybe yes i was pretty tensed about the asset's loading issue, so i asked ai to help, and i am so dumb not seeing the fixture call....
thank you so much.... and next time i try review everything instead of just completing...

nickf2k pushed a commit to nickf2k/flame that referenced this pull request Nov 16, 2025
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
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.

Add fromCache method to AssetsCache

2 participants