Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/bot/bot.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ describe('Bot Initialization', () => {
deleteOrders: sinon.stub().resolves(),
calculateEarnings: sinon.stub().resolves(),
attemptCommunitiesPendingPayments: sinon.stub().resolves(),
deleteCommunity: sinon.stub().resolves(),
// deleteCommunity: sinon.stub().resolves(),
nodeInfo: sinon.stub().resolves(),
},
'./modules/community': { configure: sinon.stub() },
Expand Down Expand Up @@ -470,7 +470,7 @@ describe('Bot Initialization', () => {

scheduledFunction();

expect(scheduleStub.scheduleJob.callCount).to.be.equal(8);
expect(scheduleStub.scheduleJob.callCount).to.be.equal(7);
expect(scheduleStub.scheduleJob.getCall(0).args[0]).to.equal(
'*/10 * * * *',
);
Expand Down
9 changes: 7 additions & 2 deletions util/imageCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,16 @@ class ImageCacheManager {
try {
// Check if the image is already base64 data (legacy format)
// Base64 strings are much longer than filenames and typically don't contain file extensions in the middle
if (image.length > 100 && !image.includes('.png') && !image.includes('.jpg') && !image.includes('.jpeg')) {
if (
image.length > 100 &&
!image.includes('.png') &&
!image.includes('.jpg') &&
!image.includes('.jpeg')
) {
logger.debug('Image appears to be base64 data, returning as-is');
return image;
}

// Otherwise, treat as filename and read from disk
const imageData = await fs.readFile(`images/${image}`);
return imageData.toString('base64');
Expand Down
Loading