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

The Same remote source ingested twice inside a single ADO will make File persister Fail #272

Open
DiegoPino opened this issue May 27, 2023 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@DiegoPino
Copy link
Member

What?

Extra edge case (and a fatal one)

if (isset($flatvalues[self::FILE_IRI_PREFIX . $uuid]) &&
isset($flatvalues[self::FILE_IRI_PREFIX . $uuid]['dr:fid']) &&
($flatvalues[self::FILE_IRI_PREFIX . $uuid]['dr:fid'] = $fid) &&
isset($flatvalues[self::FILE_IRI_PREFIX . $uuid]['url']) &&
!empty($flatvalues[self::FILE_IRI_PREFIX . $uuid]['url'])) {
// Weird egde case:
// What if same urn:uuid:uuid has multiple info structures?
// Flattener could end being double nested?
$destination_uri = $flatvalues[self::FILE_IRI_PREFIX . $uuid]['url'];
// Only deal with expensive process if destination uri is
// different to the known one.
if ($destination_uri != $current_uri) {
$destination_folder = $this->fileSystem
->dirname($destination_uri);
$this->fileSystem->prepareDirectory(
$destination_folder,
FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS
);
// Copy to new destination
$destination_uri = $this->fileSystem->copy(
$current_uri,
$destination_uri
);

But if e.g an AMI column (images) contains http://myimage.com/image1.jpeg and (docs) contains http://myimage.com/image2.jpeg when persisting the matching will mean that the flattener will bring url as an array containing TWICE the same final destination.

The solution (hard to trigger error) is in the case of an ARRAY with URLs, we can compare them, if both are the same, then we pick one, if not, then well, that can not be and we die with errors

@DiegoPino DiegoPino self-assigned this May 27, 2023
@DiegoPino DiegoPino added the bug Something isn't working label May 27, 2023
@DiegoPino DiegoPino added this to the 1.1.0 milestone May 27, 2023
@DiegoPino
Copy link
Member Author

@alliomeria what you saw today with the double /OBJ datastreams

@aksm
Copy link
Contributor

aksm commented Jun 2, 2023

@DiegoPino Have you started work on this already? Should I try to tackle it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants