title: GmailApp Won't Unstar Gmail Message
body: <p>I'm trying to unstar a message in my Apps Script project, and it's not unstarring. What am I missing?</p>
  
  <p>My code:</p>
  
  <pre><code>var label = GmailApp.getUserLabelByName("Newly Received Test Request");
  var threads = label.getThreads();
  GmailApp.refreshThreads(threads);
  for (var i in threads) {
    GmailApp.refreshThread(threads[i]);
    var messages = threads[i].getMessages();
    GmailApp.refreshMessages(messages);
    for (var j in messages) {
      GmailApp.refreshMessage(messages[j]);
      if (messages[j].isStarred()) {
        messages[j].unstar();
        Logger.log(messages[i].getPlainBody());
        GmailApp.refreshMessage(messages[j]);
      }
    }
    GmailApp.refreshThread(threads[i]);
    //threads[i].removeLabel(label);
  }
  GmailApp.refreshThreads(threads);
  return;
  </code></pre>
  
  <p>I went a little overboard with the refreshing, just in case. Still, when I run this, the starred messages in this label stay starred.</p>
  
  <p><strong>Edit</strong>: FWIW, the lag time between Apps Script unstarring a message and the Gmail UI reflecting that change seems to be getting faster over the last couple of days.</p>