@@ -207,11 +207,11 @@ export abstract class AbstractAttachmentQueue<T extends AttachmentQueueOptions =
207207 await this . powersync . writeTransaction ( deleteRecord ) ;
208208 }
209209
210- const localFilePathURI = this . getLocalUri ( record . local_uri || this . getLocalFilePathSuffix ( record . filename ) ) ;
210+ const localFilePathUri = this . getLocalUri ( record . local_uri || this . getLocalFilePathSuffix ( record . filename ) ) ;
211211
212212 try {
213213 // Delete file on storage
214- await this . storage . deleteFile ( localFilePathURI , {
214+ await this . storage . deleteFile ( localFilePathUri , {
215215 filename : record . filename
216216 } ) ;
217217 } catch ( e ) {
@@ -238,9 +238,9 @@ export abstract class AbstractAttachmentQueue<T extends AttachmentQueueOptions =
238238 throw new Error ( `No local_uri for record ${ JSON . stringify ( record , null , 2 ) } ` ) ;
239239 }
240240
241- const localFilePathURI = this . getLocalUri ( record . local_uri ) ;
241+ const localFilePathUri = this . getLocalUri ( record . local_uri ) ;
242242 try {
243- if ( ! ( await this . storage . fileExists ( localFilePathURI ) ) ) {
243+ if ( ! ( await this . storage . fileExists ( localFilePathUri ) ) ) {
244244 console . warn ( `File for ${ record . id } does not exist, skipping upload` ) ;
245245 await this . update ( {
246246 ...record ,
@@ -249,7 +249,7 @@ export abstract class AbstractAttachmentQueue<T extends AttachmentQueueOptions =
249249 return true ;
250250 }
251251
252- const fileBuffer = await this . storage . readFile ( localFilePathURI , {
252+ const fileBuffer = await this . storage . readFile ( localFilePathUri , {
253253 encoding : EncodingType . Base64 ,
254254 mediaType : record . media_type
255255 } ) ;
@@ -276,8 +276,8 @@ export abstract class AbstractAttachmentQueue<T extends AttachmentQueueOptions =
276276 if ( ! record . local_uri ) {
277277 record . local_uri = this . getLocalFilePathSuffix ( record . filename ) ;
278278 }
279- const localFilePathURI = this . getLocalUri ( record . local_uri ) ;
280- if ( await this . storage . fileExists ( localFilePathURI ) ) {
279+ const localFilePathUri = this . getLocalUri ( record . local_uri ) ;
280+ if ( await this . storage . fileExists ( localFilePathUri ) ) {
281281 console . debug ( `Local file already downloaded, marking "${ record . id } " as synced` ) ;
282282 await this . update ( { ...record , state : AttachmentState . SYNCED } ) ;
283283 return true ;
@@ -298,9 +298,9 @@ export abstract class AbstractAttachmentQueue<T extends AttachmentQueueOptions =
298298 } ) ;
299299
300300 // Ensure directory exists
301- await this . storage . makeDir ( localFilePathURI . replace ( record . filename , '' ) ) ;
301+ await this . storage . makeDir ( localFilePathUri . replace ( record . filename , '' ) ) ;
302302 // Write the file
303- await this . storage . writeFile ( localFilePathURI , base64Data , {
303+ await this . storage . writeFile ( localFilePathUri , base64Data , {
304304 encoding : EncodingType . Base64
305305 } ) ;
306306
0 commit comments