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: clear store #405

Merged
merged 2 commits into from
Dec 22, 2022
Merged

fix: clear store #405

merged 2 commits into from
Dec 22, 2022

Conversation

hetao92
Copy link
Contributor

@hetao92 hetao92 commented Dec 21, 2022

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number:

Description:

How do you solve it?

Special notes for your reviewer, ex. impact of this fix, design document, etc:

@@ -16,7 +16,7 @@ const FileUpload = () => {
const [loading, setLoading] = useState(false);
const transformFile = async (_file: StudioFile, fileList: StudioFile[]) => {
const size = fileList.reduce((acc, cur) => acc + cur.size, 0);
if(size > global.gConfig.maxBytes) {
if(global.gConfig.maxBytes && size > global.gConfig.maxBytes) {
Copy link
Contributor

@huaxiabuluo huaxiabuluo Dec 21, 2022

Choose a reason for hiding this comment

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

what's the maxBytes default value if config item is empty ?

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 think there is no need to execute this logic if it is not set or it is not read for some reason, it is better to report 413 directly

Copy link
Contributor

Choose a reason for hiding this comment

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

there is default value for maxBytes config, not setting doesn't mean it not work, see the doc below and make tests
https://go-zero.dev/docs/configuration/api?_highlight=maxbytes#restrestconf

Copy link
Contributor

Choose a reason for hiding this comment

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

go-zero@1.3.3

RestConf struct {
	service.ServiceConf
	Host     string `json:",default=0.0.0.0"`
	Port     int
	CertFile string `json:",optional"`
	KeyFile  string `json:",optional"`
	Verbose  bool   `json:",optional"`
	MaxConns int    `json:",default=10000"`
	MaxBytes int64  `json:",default=1048576"`
	// milliseconds
	Timeout      int64         `json:",default=3000"`
	CpuThreshold int64         `json:",default=900,range=[0:1000]"`
	Signature    SignatureConf `json:",optional"`
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can't read the default value

mod: code review

mod: code review
Copy link
Contributor

@huaxiabuluo huaxiabuluo left a comment

Choose a reason for hiding this comment

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

LGTM

@huaxiabuluo huaxiabuluo merged commit 38ca762 into vesoft-inc:master Dec 22, 2022
@hetao92 hetao92 deleted the hetao-fix branch December 22, 2022 09:23
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.

[Sketch] Failed to save Sketch status not cleared after exit
2 participants