question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to add to UserStorage with Kotlin

See original GitHub issue

Is there a way to modify UserStorage when using Kotlin?

UserStorage is a Map in this implementation and is not mutable. This doesn’t seem to be an issue for Java projects (example here)

Thank you!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
zonder129commented, Sep 8, 2019

Hi @Fleker, is there any update coming to solve this bug? There is still no way to properly clone userStorage map or create your own ResponseBuilder, as you did in the example above. Try it your self:

val actionRequest = MockRequestBuilder().setUserStorage(mapOf(Pair("userId","someId"))).build()
val userStorage = mutableMapOf<String, Any>()
userStorage.putAll(actionRequest.userStorage)
userStorage["key"] = "value"
println(userStorage)

The output will be only: {key=value}

ResponseBuilder is also unavailable to be created because its constructor is internal. So there is no way to create it outside com.google.actions.api.response package.

0reactions
taycaldwellcommented, Sep 9, 2019

Hello,

This issue has been addressed as of v1.7.0.

If you run into any other issues, please open a new issue.

Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

App Storage Options. Best Memory Option For Android/KOTLIN
In this article, we will go over the various types of storage and how to implement them in Android/ KOTLIN. Hopefully, this covers...
Read more >
Kotlin Android Read and Write External Storage - Javatpoint
Add the following code in the MainActivity.kt class. In this class, we are saving the file name and data inside external storage by...
Read more >
Data and file storage overview - Android Developers
... Creating a content provider · Open files using storage access framework · Create a custom document provider · App install location. User...
Read more >
Create a file on external storage - Manage your data to have a ...
We've configured EasyPermissions here so that it prompts the user to accept the WRITE_EXTERNAL_STORAGE permission as soon as the activity ...
Read more >
how to create a folder and file in internal storage using kotlin
fun test(view: View) { try { ; val myObj = File("filename.txt") ; if (myObj.createNewFile()) { println("File created: " + myObj.name) } ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found