In 2013, when Keira Drake sat down to write her debut young-adult fantasy novel, The Continent, she wanted to write about privilege, about the way that those who have it can so easily turn a blind eye to the suffering of those who don’t. Her imagination had been sparked by an NPR report about bombings in Iraq; it brought her to tears, and when she switched off the radio, she began thinking about what might happen if someone like her — someone white, sheltered, and privileged — suddenly found herself in the middle of a war between two violent societies in a foreign land. Drake set her fantasy in a place called the Continent, a brutal realm where privileged tourists, safe in their heli-planes, gaze down with detached curiosity at the native people slaughtering each other below. After a heli-plane crashes, Drake’s narrator is saved by one of the natives from an attempted rape at the hands of an enemy tribe, and she, in turn, saves his people from ruin.

Drake’s editor at Harlequin, Natashya Wilson, thought the book had best-seller potential. She offered Drake a “significant” three-book deal (publishing code for an advance between $251,000 and $499,000), and Harlequin launched a major marketing campaign, sending Drake to conferences around the country. Early readers of advance copies were enthusiastic. A review posted on Goodreads half a year before the book’s scheduled publication date hailed Drake as a visionary for her “eye-opening” revelation that “a native isn’t a savage or primitive.”

It wasn’t until five months later that a legion of less enchanted readers took to Twitter to offer a differing perspective. Justina Ireland, an African-American author of young-adult fiction, tweeted out a point-by-point summary of her read in which she called the book a “racist garbage fire.” Ireland eventually deleted the thread after receiving a barrage of death threats, rape threats, withering reviews of her own books, and an anonymous email to her editor calling her a bully and urging him to drop her. And so it was that Drake, like her protagonist, suddenly found herself at the center of a feud between two warring factions.

Over the last few years, the world of young-adult literature has been riven by a turbulent debate over race and identity. On one side are those who believe that YA publishing is too white, that too many white authors resort to stereotypes in portraying characters of color, and that these depictions are harmful to children — especially those from marginalized backgrounds. On the other side are those like the author Lionel Shriver, who wrote in a recent essay on the Guardian website that “there’s a thin line between combing through manuscripts for anything potentially objectionable to particular subgroups and overt political censorship.” This debate, in its current incarnation, can be traced back to 2014, when the organizers of BookExpo, the biggest publishing trade show of the year, convened a special panel of acclaimed children’s authors and failed to include a single woman or person of color. Young-adult author Ellen Oh began tweeting under the hashtag WeNeedDiverseBooks, and convinced the convention organizers to add a panel with authors of color, inaugurating a broad movement for greater diversity in publishing.

Drake, who’s 42 years old and lives in Salt Lake City, Utah, where she previously worked as a freelance marketing consultant, says that she wasn’t familiar with this conversation. She found herself poring over Twitter with a dawning sense of horror. One reader observed that Drake’s cast of characters included “Magic Black people, Ninja Asians, and uneducated, ruthless Natives who get drunk and try to rape the precious white girl.” Another wrote that the whole thing had “vibes of colonization.” A petition surfaced urging Harlequin to delay publication of the book and address “the troubling portrayals within of people of color and native backgrounds.”

Drake had named one of the tribes the Topi. They had reddish-brown skin, smeared their faces with war paint, and savagely attacked people with arrows, but it had not occurred to her that readers might see the Topi as a racist version of a Native-American tribe, the Hopi. “That was 100 percent unintentional,” Drake told me at the Harlequin offices in her first interview reflecting on the saga. Once readers pointed out the similarities, “it seemed so obvious,” she said. “I was ashamed. I was like, ‘Did I do this subconsciously? How could I not have seen this?’”

More than a few authors have stoked the fires of Twitter outrage with similar offenses in recent years. Wilson, Harlequin Teen’s editorial director, also oversaw the publishing of The Black Witch, another title that was widely criticized as racist. The author, Laurie Forest, is white, but not every author who has attracted controversy in this era is. Late 2015 and early 2016 saw the publication of two picture books that, in an odd coincidence, both depicted smiling slaves preparing desserts. One of them, A Birthday Cake for George Washington, was written, edited and illustrated by people of color. The publisher, Scholastic, eventually decided that the book might give readers “a false impression of the reality of the lives of slaves,” and the title was removed from bookstores.

Occasionally, authors who have caught heat in this woke era will apologize; more often, they will stand their ground. But Drake’s situation appears to be unique in one respect. After reading through the criticisms of her book, she called her editor at Harlequin and asked if she could rewrite it.

The tradition of the white hero versus the dark other has been an integral part of fantasy literature since the genre’s inception. On one level, J.R.R. Tolkien’s Lord of the Rings trilogy is about a bunch of white guys of varying body shapes beating back an invading horde of yellow-skinned, slant-eyed savages. In The Chronicles of Narnia, by C.S. Lewis, some of the principal villains, the Calormene, live in the desert, have swarthy faces and long beards, wear turbans, carry scimitars, and eat bread with oil instead of butter. “Tolkien and Lewis were men who were born when the British empire was at its height, and the cartographies of their imagination were influenced accordingly,” Ebony Elizabeth Thomas, a professor at the University of Pennsylvania’s Graduate School of Education, who focuses on race in children’s and young-adult literature, told me. “This fear and this hatred of the dark other is so deeply inscribed in the European imagination.”

Contemporary fantasy as we know it rests on the bedrock of Lewis’s and Tolkien’s imaginations, which perhaps explains why Drake would write a book that often seems at pains to mimic the voice of a Cambridge don born during the waning days of Queen Victoria’s reign. The main character, Vaela Sun, lives in a “magnificent” place called the Spire, where she works as an apprentice cartographer and says things like, “Oh, how I love my homeland!” The barbaric Topi — renamed the Xoe in the new version — don’t speak English at all, so if they have anything on their minds besides shooting people full of arrows, it goes unsaid. A few days after Ireland’s Twitter takedown, Drake, in a response published on her website, explained that she modeled the Topi not after the Hopi, but on Tolkien’s evil horde, the Uruk-hai, who are half-human and half-orc. She didn’t realize that Tolkien had based the orcs on his impressions of people from Central Asia. She sees that now. “When you do look back at these books,” she said of Tolkien and Lewis, “you can see how certain sort of negative ideas have shaped things. There’s a lot more awareness of this sort of thing now.”

Drake told me that her revision process had been “eye-opening” and an “incredible experience.” In our meeting, she was nervous but thoroughly upbeat. This time around, she was sure she’d fixed the problems that plagued the first version. “This is the book I wanted to write,” she said, “Maybe I’m not the most amazing writer in the world, but I love this story, and I can’t wait for people to read it.”

Drake found herself poring over Twitter with a dawning sense of horror.

It took several months for Drake and Wilson to figure out how to approach the revision. “I was a mess,” Drake recalled. “I felt like I had hurt people and that was really, really hard.” The criticisms were painful to read, but so were some of the comments of people who supposedly supported her. About two months after she decided to revise the book, her husband, Declan, went on a Twitter rant calling Justina Ireland a “bigoted troll.” In a Facebook post, Drake described this as “a betrayal of the worst kind.” She and Declan are now separated. (She said it had nothing to do with this incident.) Others told her that she “caved to pressure” by deciding to revise the book. Drake disagrees. “Criticism is the thing that’s going to make you better at what you do,” she said.

Drake, her agent, and her editor eventually put together a master list of problems they wanted to fix, compiled from online critiques. One way to revise the book would have been to embrace its latent potential as a commentary on colonialism in North America, or to ground it more authentically in an understanding of the real-life situation that inspired it — the war in Iraq. In the end, Drake went in the opposite direction, making a wide range of minor changes that erased any similarities between the fictional tribes and recognizable cultures. She replaced the Xoe’s “war paint” with “colorful tattoos,” and changed the Xoe’s skin color from bronze to pale. She deleted a passage in which her narrator compares the Xoe village to an “ant colony” and removed the much-criticized attempted rape scene. In response to the argument that she’d written a white-savior narrative, she made Vaela, the savior, a distant descendant of the Aven’ei, the other tribe that lives on the Continent, whose members still seem vaguely Asian, although in the new version they no longer have “almond-shaped” eyes.

Many critics bristled at what’s been described as a Trumpian section in the first version, in which Vaela urges a Spirian council to stop the war by building a wall that would separate the two tribes. “Spirian construction is vastly superior to anything the natives can contrive,” Vaela declared. In the new version, Vaela suggests the council build towers instead, and she no longer calls Spirian construction “vastly superior.” But it’s not clear that her updated line will allay the concerns of those who criticized the book for its colonial overtones. Now, Vaela urges the council to “create defenses the likes of which have never been seen on the Continent,” where the native people are still so technologically unsophisticated that they react in shock when Vaela tells them about indoor plumbing.

Drake told me that she took heart from the fact that her sensitivity readers “loved” the revision and just suggested a few minor “tweaks.” But when I spoke to one of the two sensitivity readers Harlequin had hired, she recalled sending suggestions for an extensive rewrite to Wilson, who was reluctant to pass them along to Drake. According to the reader, Wilson said she felt that they’d already put Drake through the wringer, and that another page-one revision would be too onerous. Publishers often cite their hiring of sensitivity readers as proof that they’ve done due diligence, but they pay as little as $250 per read, and they’re always free to ignore the sensitivity reader’s suggestions. Once the reader sends in their notes, they have no control over whether or how that advice is put to use.

It remains to be seen how readers will respond to the revised version of the novel, which will be released on March 27. A Kirkus review, published this month, observed that the story still “hews closely to the well-worn trope of the young Westerner who achieves self-actualization through experiencing the seemingly simple pleasures of the developing world.” Debbie Reese, the founder of American Indians in Children’s Literature, an advocacy organization, wrote a chapter-by-chapter critique of the first version in which she concluded that she didn’t believe the book could be revised. Her reading of the revision confirmed this assessment. “She made superficial changes that do not change the impact of the story,” Reese told me in an email. Yes, the natives of the Continent have less melanin now, but they remain “savage and primitive and cannot be redeemed.”

Thomas, the professor, told me that a student asked her recently whether it’s possible to write a fantasy that is “raceless.” “I said no,” she explained. “You cannot completely divorce yourself from your race or your culture or your ethnicity, because writing always happens in a context. You can try, but you’re going to leave your fingerprints on the characters whether you intend to or not.”

Jenny Trout, a white author of fantasy and romance who blogged about The Continent early on, went through a similar reckoning a few years ago. She told me she wished she had known about sensitivity readers back in 2009, when she was writing a series for Harlequin’s Mira Imprint that depicted Gypsies as “magical creatures” who were shaped as though “each was cut from a spare scrap of cloth.”

“I didn’t know the Roma were real people,” she told me. “I had the privilege of ignorance, of never having to think about any of the things I was writing because I was being influenced by white writers who created those tropes and profited.” Trout noted that it can be difficult for white writers to face up to the ways in which racism seeps into their prose. “White people are taught their entire lives that they’re not racists,” she said. “Our culture tells us that white people succeed because we’re all exceptional, even if we’re not being told explicitly that our race is superior. It’s entrenched in every part of our lives.” Trout’s biggest concern about books like The Continent, and her own series, is that the gatekeepers of publishing are still insufficiently aware of this dynamic. “The answer to the question ‘how did this get published?’ is fairly simple; white authors write books loaded with racism, the publishers that buy them either don’t have a diverse enough staff to see the problems in the books or they just don’t listen to criticism,” Trout wrote in her blog post about The Continent. “The problem with books like these begin with the authors but ultimately end with the gatekeepers.”

Wilson, who is white, stresses that Harlequin will catch more of these issues in the future. She noted that the publisher is working with sensitivity readers, and that “an inextricable part of Harlequin’s commitment to bringing readers excellent stories is a commitment to inclusivity and sensitivity.” Drake, for her part, told me that she condemns racism whenever she sees it, and that the charges of racism hurt her in part because she felt they were so untrue. But when I asked how she squares this with the controversy surrounding The Continent, she was flummoxed. “Honestly, I don’t know,” she said. “I didn’t see it.” She said the mystery would probably bother her forever. “I wrote a book about how privilege allows us to turn a blind eye to the suffering of others, and I wrote that book without seeing certain things myself, and that was incredibly humbling.”

*A version of this article appears in the February 19, 2018, issue of New York Magazine.