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: remove cache when getProjectById #3067

Merged
merged 4 commits into from
May 15, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { jsx } from '@emotion/core';
import React, { useState, FormEvent, useEffect, useCallback, useRef } from 'react';
import formatMessage from 'format-message';
import { PrimaryButton, DefaultButton } from 'office-ui-fabric-react/lib/Button';
import { Spinner, SpinnerSize } from 'office-ui-fabric-react/lib/Spinner';
import { Stack, StackItem } from 'office-ui-fabric-react/lib/Stack';
import { TextField } from 'office-ui-fabric-react/lib/TextField';
import { assignDefined, Skill } from '@bfc/shared';
Expand All @@ -17,7 +18,7 @@ import { DialogTypes } from '../../DialogWrapper/styles';
import { addSkillDialog } from '../../../constants';
import { ISkillFormData, ISkillFormDataErrors, SkillUrlRegex, SkillNameRegex } from '../types';

import { FormFieldManifestUrl, FormFieldEditName, MarginLeftSmall, FormModalBody } from './styles';
import { FormFieldManifestUrl, FormFieldEditName, MarginLeftSmall, FormModalBody, SpinnerLabel } from './styles';
import { validateManifestUrl } from './validateManifestUrl';

export interface ICreateSkillModalProps {
Expand Down Expand Up @@ -180,6 +181,9 @@ const CreateSkillModal: React.FC<ICreateSkillModalProps> = props => {
required
autoFocus
/>
{isValidating && (
<Spinner css={SpinnerLabel} size={SpinnerSize.medium} label="validating..." labelPosition="right" />
)}
<TextField
css={FormFieldEditName}
label={formatMessage('Custom name (optional)')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ export const FormFieldEditName = css`
export const MarginLeftSmall = css`
margin-left: ${FontSizes.small};
`;

export const SpinnerLabel = css`
justify-content: left;
margin-top: 0.4rem;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function filterSectionDiagnostics(diagnostics: Diagnostic[], section: LuI
return filteredDiags.map(d => {
const { range } = d;
if (range) {
d.range = offsetRange(range, offset);
return { ...d, range: offsetRange(range, offset) };
}
return d;
});
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/server/src/models/bot/skillManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const extractSkillManifestUrl = async (
const notify = new Diagnostic(
`Accessing skill manifest url error, ${manifestUrl}`,
'appsettings.json',
DiagnosticSeverity.Error
DiagnosticSeverity.Warning
);
diagnostics.push(notify);
}
Expand Down
3 changes: 0 additions & 3 deletions Composer/packages/server/src/services/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,6 @@ export class BotProjectService {
public static getProjectById = async (projectId: string, user?: UserIdentity): Promise<BotProject> => {
BotProjectService.initialize();

const cachedProject = BotProjectService.getIndexedProjectById(projectId);
if (cachedProject) return cachedProject;

if (!BotProjectService.projectLocationMap?.[projectId]) {
throw new Error('project not found in cache');
} else {
Expand Down