Commit 68c53c6
authored
Make creating DataStore files more resilient (#7440)
Prepare the DataStore files directly in the Sessions SDK, instead of
relying on DataStore to do it.
DataStore uses the old `File.mkdirs` api, which lacks any meaningful
error messages. This will use the better `Files.createDirectories` api
if available, which has proper error messages.
Also renamed the parent directory from `aqs` to `firebaseSessions` to
avoid any collision with any other libraries that might use DataStore
and a 3 letter file name. If there is an unexpected file where the
`firebaseSessions` directory should be, this will safely remove it.
Tested manually by creating the conflicting file and running the
Sessions Test App on both old and new api levels.1 parent 1246b69 commit 68c53c6
File tree
2 files changed
+52
-2
lines changed- firebase-crashlytics
- firebase-sessions/src/main/kotlin/com/google/firebase/sessions
2 files changed
+52
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
Lines changed: 50 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| |||
146 | 149 | | |
147 | 150 | | |
148 | 151 | | |
149 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
150 | 157 | | |
151 | 158 | | |
152 | 159 | | |
| |||
164 | 171 | | |
165 | 172 | | |
166 | 173 | | |
167 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
168 | 179 | | |
169 | 180 | | |
170 | 181 | | |
| |||
197 | 208 | | |
198 | 209 | | |
199 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
200 | 248 | | |
201 | 249 | | |
202 | 250 | | |
0 commit comments