Skip to content

Conversation

HazAT
Copy link
Member

@HazAT HazAT commented Feb 9, 2018

No description provided.

@HazAT HazAT self-assigned this Feb 9, 2018
@ghost
Copy link

ghost commented Feb 9, 2018

1 Warning
⚠️ You should update CHANGES due to the size of this PR

Generated by 🚫 danger

@HazAT HazAT requested review from jan-auer and mitsuhiko February 9, 2018 11:55
Copy link
Member

@jan-auer jan-auer left a comment

Choose a reason for hiding this comment

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

Looks good generally. One thing though: Isn't it possible to load the ProjectDsymFile along with the Files (via joining) to reduce the number of DB requests?

elif len(file_blobs) == len(owned_blobs) == len(chunks) and file is not None:
return self._create_file_response(
ChunkFileState.OK
file.headers.get('__state', ChunkFileState.OK)
Copy link
Member

Choose a reason for hiding this comment

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

That could use a constant, maybe

file=found_file
).first()
if dsym is not None:
response['dif'] = serialize(dsym)
Copy link
Member

Choose a reason for hiding this comment

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

This should even be required if the state is OK and log an error if the ProjectDsymFile is missing since it indicates that something went wrong and we weren't able to write the correct state header.

Copy link
Member Author

Choose a reason for hiding this comment

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

We can't check this here, since the original chunked file will be deleted, only the new dsym file is in the database without the __state header at all.
So pretty much the API returns OK if there is no state header but a file with owned blobs.

def _add_project_dsym_to_reponse(self, found_file, response):
if found_file is not None:
if found_file.headers.get('error', None) is not None:
response['error'] = found_file.headers.get('error')
Copy link
Member

Choose a reason for hiding this comment

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

Maybe just a minor consistency thing, but: What if there is an error header but the state is OK? In that case it is weird, that you're adding that field.

Copy link
Member Author

Choose a reason for hiding this comment

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

The database doesn't prevent this from happening, but there is no codepath setting OK and error. So when there is an error state is also an error.

@HazAT
Copy link
Member Author

HazAT commented Feb 9, 2018

In regards to your first comment.
The File will be fetched earlier in the "general" ChunkMixin that doesn't know anything about difs.
That's why it's hard to join, because only the dif endpoint knows about dsyms/difs.

Copy link
Contributor

@mitsuhiko mitsuhiko left a comment

Choose a reason for hiding this comment

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

wfm

@HazAT HazAT merged commit 977561b into master Feb 9, 2018
@HazAT HazAT deleted the feature/enhance-dif-assemble branch February 9, 2018 12:42
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants