Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: blobs transcript date filter #3877

Merged
merged 2 commits into from
Jul 21, 2021

Conversation

joshgummersall
Copy link
Contributor

Fixes #3864

@joshgummersall joshgummersall requested a review from a team as a code owner July 21, 2021 19:47
@@ -141,8 +141,7 @@ export class BlobsTranscriptStore implements TranscriptStore {
const fromIdx =
startDate != null
? blobItems.findIndex(
(blobItem) =>
blobItem?.metadata?.timestamp && new Date(blobItem.metadata.timestamp) >= startDate
(blobItem) => blobItem?.properties?.createdOn && blobItem?.properties?.createdOn >= startDate
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I logged the blobItems array and found that metadata is undefined by default, so I opted for this property that does exist. I tested against a real blob storage container.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is createdOn already a Date() obj?

This change still works with local storage emulation, too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is, yes. I'll test with the emulator as well. It should as the Typescript type definitions should be correct. Will double check though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mdrichardson Emulator checks out!

@@ -5,7 +5,7 @@ import * as z from 'zod';
import getStream from 'get-stream';
import pmap from 'p-map';
import { Activity, PagedResult, TranscriptInfo, TranscriptStore } from 'botbuilder-core';
import { maybeCast } from 'botbuilder-stdlib/lib/maybeCast';
import { maybeCast } from 'botbuilder-stdlib';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple fix here, auto-import included the wrong path before.

@coveralls
Copy link

coveralls commented Jul 21, 2021

Pull Request Test Coverage Report for Build 1054042577

  • 1 of 2 (50.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 84.322%

Changes Missing Coverage Covered Lines Changed/Added Lines %
libraries/botbuilder-azure-blobs/src/blobsTranscriptStore.ts 1 2 50.0%
Totals Coverage Status
Change from base Build 1053868903: 0.1%
Covered Lines: 19685
Relevant Lines: 22143

💛 - Coveralls

@joshgummersall joshgummersall merged commit 64926f4 into main Jul 21, 2021
@joshgummersall joshgummersall deleted the jpg/fix-blobs-transcript-date-filter branch July 21, 2021 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getTranscriptActivities failing to retrieve transcripts from storage when passing in a start time
3 participants