Skip to content

Temporary files not cleaned up in PDF and Word controllers - potential disk bloat #46

@coderabbitai

Description

@coderabbitai

Issue Description

The PDF and Word controllers in OsmoDoc.API create temporary files that are not being fully cleaned up after processing, which could lead to disk bloat over time on busy API instances.

Files Not Being Cleaned Up

In PdfController:

  • Input template files (htmlTemplateFilePath/ejsTemplateFilePath) created from base64 data
  • Output PDF files (outputFilePath) after conversion to base64 response

In WordController:

  • WordDocumentGenerator appears to have no cleanup logic at all

Current Behavior

While PdfDocumentGenerator.GeneratePdf() does delete some internal temporary files (converted HTML, modified HTML, JSON data files), it does not delete the input template files or output files created by the controller.

Context

This issue was identified during code review and the decision was made to keep the current behavior for now but address it in a future enhancement.

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions